結果

問題 No.185 和風
ユーザー 💕💖💞💕💖💞
提出日時 2017-06-25 22:24:29
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 347 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 16,820 ms
コンパイル使用メモリ 418,240 KB
実行使用メモリ 54,768 KB
最終ジャッジ日時 2023-08-12 19:52:14
合計ジャッジ時間 17,042 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 320 ms
53,040 KB
testcase_01 AC 338 ms
53,168 KB
testcase_02 AC 339 ms
54,768 KB
testcase_03 AC 340 ms
53,388 KB
testcase_04 AC 347 ms
52,984 KB
testcase_05 AC 304 ms
52,980 KB
testcase_06 AC 337 ms
52,952 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