結果

問題 No.677 10^Nの約数
ユーザー 💕💖💞💕💖💞
提出日時 2018-05-06 23:24:00
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 419 bytes
コンパイル時間 12,250 ms
コンパイル使用メモリ 430,212 KB
実行使用メモリ 60,536 KB
最終ジャッジ日時 2024-04-30 18:31:38
合計ジャッジ時間 16,333 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 290 ms
60,244 KB
testcase_01 AC 285 ms
60,180 KB
testcase_02 AC 283 ms
60,312 KB
testcase_03 AC 287 ms
60,172 KB
testcase_04 AC 292 ms
60,292 KB
testcase_05 AC 287 ms
60,188 KB
testcase_06 AC 301 ms
60,408 KB
testcase_07 AC 288 ms
60,340 KB
testcase_08 AC 294 ms
60,404 KB
testcase_09 AC 294 ms
60,280 KB
testcase_10 AC 295 ms
60,288 KB
testcase_11 AC 296 ms
60,200 KB
testcase_12 AC 292 ms
60,360 KB
testcase_13 AC 299 ms
60,244 KB
testcase_14 AC 290 ms
60,356 KB
testcase_15 AC 315 ms
60,520 KB
testcase_16 AC 314 ms
60,536 KB
testcase_17 AC 310 ms
60,516 KB
testcase_18 AC 315 ms
60,384 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^
Main.kt:19:7: warning: name shadowed: two
  for(two in twos) {
      ^
Main.kt:20:9: warning: name shadowed: five
    for(five in fives) {
        ^

ソースコード

diff #

fun main(args:Array<String>) {
  val n = readLine()!!.toInt()
  
  var two = 1L
  val twos = mutableSetOf(1L)
  (1..n).map { 
    two *= 2L
    twos.add(two)
  }

  var five = 1L
  val fives = mutableSetOf(1L)
  (1..n).map { 
    five *= 5L
    fives.add(five)
  }
  
  val res = mutableSetOf(1L)
  for(two in twos) {
    for(five in fives) {
      res.add(two*five)
    }
  }
  res.sorted().map {
    println(it)
  }
}
0