結果

問題 No.296 n度寝
ユーザー cande398cande398
提出日時 2017-10-10 17:11:39
言語 Java21
(openjdk 21)
結果
AC  
実行時間 142 ms / 1,000 ms
コード長 554 bytes
コンパイル時間 2,111 ms
コンパイル使用メモリ 74,404 KB
実行使用メモリ 57,288 KB
最終ジャッジ日時 2023-08-10 22:28:06
合計ジャッジ時間 5,346 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
56,712 KB
testcase_01 AC 139 ms
56,656 KB
testcase_02 AC 136 ms
56,928 KB
testcase_03 AC 138 ms
56,952 KB
testcase_04 AC 139 ms
56,740 KB
testcase_05 AC 142 ms
56,920 KB
testcase_06 AC 140 ms
56,652 KB
testcase_07 AC 142 ms
56,912 KB
testcase_08 AC 138 ms
57,048 KB
testcase_09 AC 136 ms
57,288 KB
testcase_10 AC 139 ms
57,016 KB
testcase_11 AC 140 ms
57,200 KB
testcase_12 AC 137 ms
56,988 KB
testcase_13 AC 138 ms
57,096 KB
testcase_14 AC 141 ms
56,860 KB
testcase_15 AC 139 ms
56,808 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