結果

問題 No.652 E869120 and TimeZone
ユーザー 💕💖💞💕💖💞
提出日時 2018-06-26 04:51:12
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 320 ms / 1,000 ms
コード長 451 bytes
コンパイル時間 11,465 ms
コンパイル使用メモリ 421,288 KB
実行使用メモリ 55,844 KB
最終ジャッジ日時 2023-09-02 05:29:41
合計ジャッジ時間 23,717 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 315 ms
53,900 KB
testcase_01 AC 309 ms
53,988 KB
testcase_02 AC 310 ms
54,012 KB
testcase_03 AC 310 ms
54,060 KB
testcase_04 AC 312 ms
54,244 KB
testcase_05 AC 311 ms
54,344 KB
testcase_06 AC 311 ms
53,844 KB
testcase_07 AC 302 ms
53,908 KB
testcase_08 AC 315 ms
53,972 KB
testcase_09 AC 300 ms
53,976 KB
testcase_10 AC 303 ms
53,852 KB
testcase_11 AC 302 ms
53,740 KB
testcase_12 AC 308 ms
54,004 KB
testcase_13 AC 304 ms
54,060 KB
testcase_14 AC 310 ms
54,392 KB
testcase_15 AC 311 ms
53,884 KB
testcase_16 AC 303 ms
53,904 KB
testcase_17 AC 303 ms
53,860 KB
testcase_18 AC 309 ms
53,820 KB
testcase_19 AC 298 ms
53,788 KB
testcase_20 AC 308 ms
54,020 KB
testcase_21 AC 308 ms
55,808 KB
testcase_22 AC 299 ms
54,068 KB
testcase_23 AC 303 ms
54,068 KB
testcase_24 AC 318 ms
54,012 KB
testcase_25 AC 307 ms
55,844 KB
testcase_26 AC 298 ms
53,732 KB
testcase_27 AC 320 ms
53,864 KB
testcase_28 AC 308 ms
53,784 KB
testcase_29 AC 310 ms
55,832 KB
testcase_30 AC 308 ms
53,852 KB
testcase_31 AC 306 ms
53,804 KB
testcase_32 AC 307 ms
54,060 KB
testcase_33 AC 306 ms
53,856 KB
testcase_34 AC 299 ms
53,840 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
         ^
Main.kt:13:27: warning: the expression is unused
  when( m > 0 ) { true -> null; else -> { m += 60; h-=1 } }
                          ^
Main.kt:14:27: warning: the expression is unused
  when( h > 0 ) { true -> null; else -> { h += 24 } }
                          ^

ソースコード

diff #

fun main(args:Array<String>) {
  val (a,b,c) = readLine()!!.split(" ")

  var h = a.toInt()
  var m = b.toInt()
  val delta = c.replace("UTC", "").toDouble() - 9

  h += delta.toInt()
  h = h % 24

  m += Math.round((delta - delta.toInt().toDouble())*60).toInt()

  when( m > 0 ) { true -> null; else -> { m += 60; h-=1 } }
  when( h > 0 ) { true -> null; else -> { h += 24 } }

  h += m/60
  m = m%60

  h = h%24
  println("%02d:%02d".format(h, m))
}
0