結果
問題 |
No.296 n度寝
|
ユーザー |
![]() |
提出日時 | 2018-05-02 00:50:49 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 1,823 ms |
コンパイル使用メモリ | 73,804 KB |
実行使用メモリ | 54,284 KB |
最終ジャッジ日時 | 2024-06-28 00:17:20 |
合計ジャッジ時間 | 4,366 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 8 WA * 8 |
ソースコード
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int H = scan.nextInt(); int M = scan.nextInt(); int T = scan.nextInt(); scan.close(); int t = H * 60 + M; int max = 23 * 60 + 59; int k = ((N - 1) * T) % max; //System.out.println(k); int m = 0; if(k <= max - t) { m = t + k; }else { m = k - (max - t); } int ans1 = m / 60; int ans2 = m % 60; System.out.println(ans1); System.out.println(ans2); } }