結果
問題 | No.1723 [Cherry 3rd Tune *] Dead on |
ユーザー | 箱星 |
提出日時 | 2021-10-29 21:22:24 |
言語 | Kotlin (1.9.23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,923 bytes |
コンパイル時間 | 14,536 ms |
コンパイル使用メモリ | 441,528 KB |
実行使用メモリ | 58,664 KB |
最終ジャッジ日時 | 2024-10-07 09:31:41 |
合計ジャッジ時間 | 27,626 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 275 ms
50,160 KB |
testcase_02 | AC | 273 ms
49,932 KB |
testcase_03 | AC | 284 ms
50,048 KB |
testcase_04 | AC | 284 ms
50,052 KB |
testcase_05 | AC | 280 ms
50,000 KB |
testcase_06 | AC | 272 ms
50,068 KB |
testcase_07 | AC | 262 ms
49,852 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 287 ms
50,092 KB |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | AC | 272 ms
49,972 KB |
testcase_34 | WA | - |
testcase_35 | WA | - |
testcase_36 | AC | 297 ms
50,020 KB |
testcase_37 | WA | - |
testcase_38 | AC | 266 ms
50,040 KB |
testcase_39 | AC | 264 ms
50,196 KB |
testcase_40 | WA | - |
testcase_41 | WA | - |
testcase_42 | WA | - |
testcase_43 | WA | - |
testcase_44 | AC | 267 ms
50,076 KB |
testcase_45 | AC | 269 ms
50,080 KB |
testcase_46 | WA | - |
testcase_47 | WA | - |
testcase_48 | AC | 263 ms
49,940 KB |
testcase_49 | AC | 259 ms
50,060 KB |
ソースコード
import java.io.PrintWriter import java.util.* import kotlin.math.* fun PrintWriter.solve() { val x = nextLong() val a = nextLong() val y = nextLong() val b = nextLong() // region prime factorization var number = x var divisor = 2L val pf = mutableMapOf<Long, Long>() while (divisor * divisor <= number) { var count = 0 while (number % divisor == 0L) { number /= divisor count++ } if (count > 0) { pf[divisor] = count * a } divisor++ } if (number > 1) pf[number] = a // endregion // region prime factorization number = y divisor = 2L val pf2 = mutableMapOf<Long, Long>() while (divisor * divisor <= number) { var count = 0 while (number % divisor == 0L) { number /= divisor count++ } if (count > 0) { pf2[divisor] = count * b } divisor++ } if (number > 1) pf2[number] = b // endregion for (k in pf2.keys) { if (!pf.containsKey(k)) { pf[k] = 0 } } if (pf.keys.all { pf[it]!! <= pf2[it] ?: 0 }) { println("Yes") } else { println("No") } } fun main() { Thread(null, { val writer = PrintWriter(System.out, false) writer.solve() writer.flush() }, "solve", abs(1L.shl(26))) .apply { setUncaughtExceptionHandler { _, e -> e.printStackTrace(); kotlin.system.exitProcess(1) } } .apply { start() }.join() } // region Scanner private var st = StringTokenizer("") private val br = System.`in`.bufferedReader() 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() // endregion