結果

問題 No.185 和風
ユーザー 💕💖💞💕💖💞
提出日時 2017-06-25 22:22:25
言語 Kotlin
(1.9.23)
結果
WA  
実行時間 -
コード長 346 bytes
コンパイル時間 13,001 ms
コンパイル使用メモリ 443,980 KB
実行使用メモリ 57,552 KB
最終ジャッジ日時 2024-04-30 14:54:31
合計ジャッジ時間 15,615 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 338 ms
57,232 KB
testcase_01 AC 368 ms
57,404 KB
testcase_02 AC 360 ms
57,552 KB
testcase_03 AC 375 ms
57,324 KB
testcase_04 AC 366 ms
57,480 KB
testcase_05 WA -
testcase_06 AC 368 ms
57,460 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