This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"os/exec" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
) | |
func main() { | |
if len(os.Args) < 3 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
testGetPostOrder() | |
} | |
fun testGetPostOrder() { | |
val testSet = arrayOf( | |
Triple(arrayOf(7, 5, 1, 6, 2, 9, 4, 3, 8), arrayOf(1, 5, 2, 6, 9, 7, 3, 4, 8), arrayOf(1, 2, 9, 6, 5, 3, 8, 4, 7)), | |
Triple(arrayOf(1, 2, 3), arrayOf(2, 1, 3), arrayOf(2, 3, 1)), | |
Triple(arrayOf(2, 3, 1), arrayOf(1, 2, 3), null), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File | |
import kotlin.math.abs | |
interface Page { | |
fun init(d: Double) | |
fun spread(a: MutableList<Page>?) | |
fun applyChanged(): Boolean | |
fun link(p: Page) | |
fun receive(score: Double) | |
fun spreadOut(l: MutableList<Page>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun main() { | |
val (_, c) = readLine()!!.split(" ").map { it.toInt() } | |
val rs = readLine()!!.split(" ").map { it.toInt() }.filter { it < c }.toList() | |
println(rs.joinToString(" ")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
n := 0 | |
fmt.Scanf("%d\n", &n) | |
arr := make([][]int, n) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
n := 0 | |
fmt.Scanf("%d\n", &n) | |
arr := make([][]int, n) | |
for i := 0; i < n; i++ { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let mut n = String::new(); | |
std::io::stdin().read_line(&mut n).expect("not readable"); | |
let n = n.trim().split(" ").collect::<Vec<&str>>(); | |
let (n, m) = (n.get(0).unwrap().parse::<usize>().unwrap(), n.get(1).unwrap().parse::<usize>().unwrap()); | |
let mut map = vec![]; | |
for i in 0..n { | |
let mut str = String::new(); | |
std::io::stdin().read_line(&mut str).expect("not readable board"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns prac.core | |
(:require [clojure.string :as str])) | |
(defn -main [] | |
(let [[x c] (as-> (read-line) a | |
(str/split a #" ") | |
(map #(Integer. %) a)) | |
l (as-> (for [_ (range x)] | |
(Double. (read-line))) a | |
(sort a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func GetFreePort() (string, error) { | |
conn, err := net.Listen("tcp", "127.0.0.1:0") | |
if err != nil { | |
return "", err | |
} | |
defer conn.Close() | |
sp := strings.Split(conn.Addr().String(), ":") | |
if len(sp) < 2 { | |
return "", errors.New("not exist port") | |
} |
OlderNewer