結果

問題 No.185 和風
ユーザー 💕💖💞
提出日時 2017-06-25 22:24:29
言語 Kotlin
(2.1.0)
結果
AC  
実行時間 370 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 12,226 ms
コンパイル使用メモリ 437,352 KB
実行使用メモリ 57,532 KB
最終ジャッジ日時 2024-11-20 10:38:17
合計ジャッジ時間 15,568 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
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