結果
問題 | No.598 オーバーフローファンタジー |
ユーザー | 💕💖💞 |
提出日時 | 2018-03-08 10:02:49 |
言語 | Kotlin (1.9.23) |
結果 |
WA
|
実行時間 | - |
コード長 | 678 bytes |
コンパイル時間 | 11,967 ms |
コンパイル使用メモリ | 437,380 KB |
実行使用メモリ | 439,468 KB |
最終ジャッジ日時 | 2024-04-30 17:16:41 |
合計ジャッジ時間 | 20,481 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 339 ms
98,276 KB |
testcase_02 | AC | 547 ms
95,280 KB |
testcase_03 | WA | - |
testcase_04 | AC | 332 ms
60,284 KB |
testcase_05 | WA | - |
testcase_06 | AC | 337 ms
60,256 KB |
testcase_07 | AC | 335 ms
60,264 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | AC | 337 ms
60,308 KB |
testcase_11 | AC | 334 ms
60,500 KB |
testcase_12 | MLE | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used fun main(args:Array<String>) { ^
ソースコード
fun main(args:Array<String>) { val n = readLine()!!.toInt() val x = readLine()!!.toInt() val a = readLine()!!.toInt() val b = readLine()!!.toInt() // 通常攻撃での減産 val normal = Math.ceil(x.toDouble() / a).toInt() // 補数 val xb = java.lang.Integer.toBinaryString(x) val bb = java.lang.Integer.toBinaryString(b) var sum = xb.toInt(2) var result = 0 for( i in (1..normal+1)) { sum += bb.toInt(2) val sumstr = java.lang.Integer.toBinaryString(sum).padStart(n, '0') //println(sumstr) if( sumstr[0] == '1' ) { result = i break } } val output = listOf(normal, result).min() println(output) }