結果

問題 No.185 和風
ユーザー 💕💖💞💕💖💞
提出日時 2017-06-25 22:24:29
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 403 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 12,561 ms
コンパイル使用メモリ 440,644 KB
実行使用メモリ 57,568 KB
最終ジャッジ日時 2024-04-30 14:56:26
合計ジャッジ時間 16,071 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 350 ms
57,300 KB
testcase_01 AC 403 ms
57,448 KB
testcase_02 AC 373 ms
57,568 KB
testcase_03 AC 379 ms
57,452 KB
testcase_04 AC 378 ms
57,460 KB
testcase_05 AC 334 ms
56,972 KB
testcase_06 AC 373 ms
57,452 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:11: warning: parameter 'array' is never used
fun main( array : Array<String> ) {
          ^

ソースコード

diff #

fun main( array : Array<String> ) {
  val n  = readLine()!!.toInt() 
  val bs = (1..n).map { 
    val (a,b) = readLine()!!.split(" ").map { it.toInt() }
    b - a
  }
  val cs = bs.map { it - bs.first() }.all { it == 0 }
  when { 
    cs == true && bs.first() >  0 -> println( bs.first() )
    else                          -> println( -1 )
  }
}
0