結果

問題 No.296 n度寝
ユーザー GBGB
提出日時 2018-04-10 21:38:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 2,426 ms
コンパイル使用メモリ 71,636 KB
実行使用メモリ 56,500 KB
最終ジャッジ日時 2023-09-09 03:50:47
合計ジャッジ時間 5,603 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 113 ms
55,880 KB
testcase_04 AC 114 ms
55,824 KB
testcase_05 AC 115 ms
55,596 KB
testcase_06 AC 116 ms
55,880 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 118 ms
55,844 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 114 ms
56,152 KB
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;

class Main{
  public static void main(String[] args) throws IOException{

    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int h=Integer.parseInt(scan.next());
    int m=Integer.parseInt(scan.next());
    int t=Integer.parseInt(scan.next());

    m+=t*(n-1);

    if(m>=60){
      h+=m/60;
      m-=t*(n-1);
      if(h>23){
        h=0;
      }
    }

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