結果

問題 No.537 ユーザーID
ユーザー 💕💖💞💕💖💞
提出日時 2017-07-01 06:40:56
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 470 ms / 2,000 ms
コード長 557 bytes
コンパイル時間 12,840 ms
コンパイル使用メモリ 436,028 KB
実行使用メモリ 77,496 KB
最終ジャッジ日時 2024-04-30 15:04:08
合計ジャッジ時間 27,150 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 336 ms
60,132 KB
testcase_01 AC 332 ms
60,124 KB
testcase_02 AC 335 ms
60,244 KB
testcase_03 AC 333 ms
60,136 KB
testcase_04 AC 331 ms
60,260 KB
testcase_05 AC 333 ms
60,288 KB
testcase_06 AC 330 ms
60,120 KB
testcase_07 AC 335 ms
60,352 KB
testcase_08 AC 336 ms
60,124 KB
testcase_09 AC 337 ms
60,168 KB
testcase_10 AC 333 ms
60,060 KB
testcase_11 AC 334 ms
60,120 KB
testcase_12 AC 336 ms
60,172 KB
testcase_13 AC 335 ms
60,308 KB
testcase_14 AC 334 ms
60,232 KB
testcase_15 AC 338 ms
60,120 KB
testcase_16 AC 339 ms
60,208 KB
testcase_17 AC 339 ms
60,124 KB
testcase_18 AC 387 ms
70,628 KB
testcase_19 AC 389 ms
74,848 KB
testcase_20 AC 391 ms
74,536 KB
testcase_21 AC 384 ms
66,548 KB
testcase_22 AC 394 ms
74,720 KB
testcase_23 AC 388 ms
66,680 KB
testcase_24 AC 371 ms
62,556 KB
testcase_25 AC 396 ms
74,644 KB
testcase_26 AC 397 ms
74,948 KB
testcase_27 AC 388 ms
70,676 KB
testcase_28 AC 442 ms
64,920 KB
testcase_29 AC 470 ms
77,496 KB
testcase_30 AC 461 ms
71,356 KB
testcase_31 AC 382 ms
64,544 KB
testcase_32 AC 382 ms
64,532 KB
testcase_33 AC 439 ms
75,256 KB
testcase_34 AC 394 ms
68,688 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:2:11: warning: parameter 'args' is never used
fun main( args : Array<String> ) {
          ^
Main.kt:15:45: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Pair<Long, Long>
          listOf( it!!.first.toString() + it!!.second.toString() , it!!.second.toString() + it!!.first.toString() )
                                            ^
Main.kt:15:70: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Pair<Long, Long>
          listOf( it!!.first.toString() + it!!.second.toString() , it!!.second.toString() + it!!.first.toString() )
                                                                     ^
Main.kt:15:95: warning: unnecessary non-null assertion (!!) on a non-null receiver of type Pair<Long, Long>
          listOf( it!!.first.toString() + it!!.second.toString() , it!!.second.toString() + it!!.first.toString() )
                                                                                              ^

ソースコード

diff #

import java.lang.Math
fun main( args : Array<String> ) {
  readLine()!!.toLong()
    .let {
      (1..Math.pow(it.toDouble(), 0.5).toLong()).map { i ->
        when { 
          it%i.toLong() == 0L -> Pair(i, it/i)
          else -> null
        }
      }.filter { 
        it != null 
      }.toSet()
      .let {
        it.map {
          listOf( it!!.first.toString() + it!!.second.toString() , it!!.second.toString() + it!!.first.toString() )
        }.flatMap { it 
        }.toSet()
        .let {
          println(it.size)
        }
      }
    }
}
0