結果

問題 No.296 n度寝
ユーザー kenji_shioyakenji_shioya
提出日時 2016-06-02 18:40:07
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 406 bytes
コンパイル時間 3,370 ms
コンパイル使用メモリ 71,628 KB
実行使用メモリ 55,968 KB
最終ジャッジ日時 2023-09-21 08:27:09
合計ジャッジ時間 6,463 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,788 KB
testcase_01 AC 126 ms
55,840 KB
testcase_02 AC 126 ms
55,444 KB
testcase_03 AC 127 ms
55,696 KB
testcase_04 AC 128 ms
55,820 KB
testcase_05 AC 128 ms
55,692 KB
testcase_06 AC 132 ms
55,788 KB
testcase_07 AC 129 ms
55,760 KB
testcase_08 AC 127 ms
55,708 KB
testcase_09 AC 129 ms
55,436 KB
testcase_10 AC 130 ms
55,792 KB
testcase_11 AC 129 ms
55,804 KB
testcase_12 AC 128 ms
55,696 KB
testcase_13 AC 127 ms
55,748 KB
testcase_14 AC 128 ms
55,876 KB
testcase_15 AC 126 ms
55,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Exercise50{
  public static void main (String[] args){

    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    int h = sc.nextInt();
    int m = sc.nextInt();
    int t = sc.nextInt();

    int sum = t * (n - 1) + m;
    h += sum / 60;
    if (h > 23){
      h = h % 24;
    }
    m = sum % 60;

    System.out.println(h);
    System.out.println(m);
  }
}
0