結果

問題 No.296 n度寝
ユーザー Yosuke YamaguchiYosuke Yamaguchi
提出日時 2020-12-30 23:00:43
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 669 bytes
コンパイル時間 3,850 ms
コンパイル使用メモリ 75,164 KB
実行使用メモリ 41,364 KB
最終ジャッジ日時 2024-04-16 23:29:31
合計ジャッジ時間 6,735 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
41,168 KB
testcase_01 AC 132 ms
41,140 KB
testcase_02 AC 131 ms
40,876 KB
testcase_03 AC 130 ms
41,172 KB
testcase_04 AC 128 ms
41,364 KB
testcase_05 AC 132 ms
41,172 KB
testcase_06 AC 130 ms
41,108 KB
testcase_07 AC 131 ms
41,280 KB
testcase_08 AC 130 ms
41,028 KB
testcase_09 AC 131 ms
41,220 KB
testcase_10 AC 115 ms
40,228 KB
testcase_11 AC 128 ms
41,112 KB
testcase_12 AC 132 ms
40,920 KB
testcase_13 AC 130 ms
40,944 KB
testcase_14 AC 130 ms
41,188 KB
testcase_15 AC 129 ms
41,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class nDoNe296 {

  // https://yukicoder.me/problems/no/296
  public static void main(String[] args) {
    // 標準入力から読み込む際に、Scan
    Scanner sc = new Scanner(System.in);

    int awakeCount = Integer.parseInt(sc.next());
    int hour = Integer.parseInt(sc.next());
    int minute = Integer.parseInt(sc.next());
    int interval = Integer.parseInt(sc.next());

    minute += (awakeCount - 1) * interval;
    if (minute >= 60) {
      hour += minute / 60;
      minute = minute % 60;
    }

    if (hour >= 24) {
      hour = hour % 24;
    }
    System.out.println(hour);
    System.out.println(minute);

  }
}
0