結果

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