結果

問題 No.296 n度寝
ユーザー cande398cande398
提出日時 2017-10-10 17:11:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 159 ms / 1,000 ms
コード長 554 bytes
コンパイル時間 2,612 ms
コンパイル使用メモリ 86,300 KB
実行使用メモリ 55,112 KB
最終ジャッジ日時 2024-04-28 15:27:48
合計ジャッジ時間 5,098 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
54,712 KB
testcase_01 AC 152 ms
55,112 KB
testcase_02 AC 143 ms
54,760 KB
testcase_03 AC 134 ms
54,420 KB
testcase_04 AC 133 ms
54,332 KB
testcase_05 AC 142 ms
54,680 KB
testcase_06 AC 141 ms
54,760 KB
testcase_07 AC 149 ms
54,900 KB
testcase_08 AC 146 ms
54,836 KB
testcase_09 AC 133 ms
54,328 KB
testcase_10 AC 130 ms
54,380 KB
testcase_11 AC 135 ms
54,556 KB
testcase_12 AC 127 ms
54,360 KB
testcase_13 AC 147 ms
54,712 KB
testcase_14 AC 146 ms
54,760 KB
testcase_15 AC 135 ms
54,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  public static void main(String[] args){
    int i;
    Scanner sc = new Scanner(System.in);
    String[] line = sc.nextLine().split(" ");
    int[] time = new int[4];
    for(i=0;i<4;i++)time[i] = Integer.parseInt(line[i]);
    time[2] = time[2] + (time[0] - 1) * time[3];
    while(time[2] > 1440){
      time[2] -= 1440;
    }
    while(time[2]>59){
      time[1]++;
      if(time[1]>23){
        time[1] = 0;
      }
      time[2] = time[2] - 60;
    }
    System.out.println(time[1] + "\n" + time[2]);
  }
}
0