結果
問題 |
No.1004 サイコロの実装 (2)
|
ユーザー |
|
提出日時 | 2020-03-06 21:30:52 |
言語 | Kotlin (2.1.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 890 bytes |
コンパイル時間 | 11,996 ms |
コンパイル使用メモリ | 435,464 KB |
実行使用メモリ | 51,076 KB |
最終ジャッジ日時 | 2024-10-14 04:18:05 |
合計ジャッジ時間 | 24,675 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 RE * 1 |
other | AC * 2 WA * 1 RE * 35 |
コンパイルメッセージ
Main.kt:7:10: warning: parameter 'args' is never used fun main(args: Array<String>) { ^ Main.kt:9:9: warning: variable 'a' is never used val a = sc.nextInt() ^ Main.kt:10:9: warning: variable 'b' is never used val b = sc.nextInt() ^
ソースコード
import java.io.BufferedReader import java.io.InputStream import java.io.InputStreamReader import java.lang.StringBuilder import java.util.* fun main(args: Array<String>) { val sc = FastScanner(System.`in`) val a = sc.nextInt() val b = sc.nextInt() val x0 = sc.nextInt() val n = sc.nextInt() if (x0 % 2 == 0) { println("%d %d".format(n / 2, 0)) } else { println("%d %d".format(0, n / 2)) } } class FastScanner(s: InputStream) { private var st = StringTokenizer("") private val br = BufferedReader(InputStreamReader(s)) fun next(): String { while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine()) return st.nextToken() } fun nextInt() = next().toInt() fun nextLong() = next().toLong() fun nextLine() = br.readLine() fun nextDouble() = next().toDouble() fun ready() = br.ready() }