結果

問題 No.296 n度寝
ユーザー UEUEUE66UEUEUE66
提出日時 2018-05-28 09:20:36
言語 Scala(Beta)
(3.3.1)
結果
AC  
実行時間 955 ms / 1,000 ms
コード長 487 bytes
コンパイル時間 7,422 ms
コンパイル使用メモリ 240,740 KB
実行使用メモリ 64,980 KB
最終ジャッジ日時 2023-12-25 12:58:37
合計ジャッジ時間 24,769 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 929 ms
64,924 KB
testcase_01 AC 943 ms
64,956 KB
testcase_02 AC 926 ms
64,960 KB
testcase_03 AC 933 ms
64,968 KB
testcase_04 AC 944 ms
64,960 KB
testcase_05 AC 939 ms
64,952 KB
testcase_06 AC 933 ms
64,964 KB
testcase_07 AC 935 ms
64,960 KB
testcase_08 AC 949 ms
64,948 KB
testcase_09 AC 937 ms
64,960 KB
testcase_10 AC 945 ms
64,948 KB
testcase_11 AC 936 ms
64,968 KB
testcase_12 AC 934 ms
64,924 KB
testcase_13 AC 938 ms
64,952 KB
testcase_14 AC 955 ms
64,940 KB
testcase_15 AC 942 ms
64,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner

object ndone {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val n, h0, m0, t = sc.nextInt
    var h1, h2, m1, m2 = 0
    var over = (n-1)*t
    m1 = m0 + over
    if(m1 < 60) {
      println(h0)
      println(m1)
    } else {
      h1 = h0 + m1 / 60
      m2 = m1 % 60
      if(h1 < 24) {
        println(h1)
        println(m2)
      } else {
        h2 = h1 % 24
        println(h2)
        println(m2)
      }
    }
  }
}
0