結果
問題 | No.296 n度寝 |
ユーザー | intercept6 |
提出日時 | 2020-09-17 21:25:16 |
言語 | TypeScript (5.4.3) |
結果 |
AC
|
実行時間 | 83 ms / 1,000 ms |
コード長 | 1,109 bytes |
コンパイル時間 | 7,391 ms |
コンパイル使用メモリ | 253,740 KB |
実行使用メモリ | 44,220 KB |
最終ジャッジ日時 | 2023-09-04 07:37:47 |
合計ジャッジ時間 | 9,501 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 80 ms
44,220 KB |
testcase_01 | AC | 80 ms
41,944 KB |
testcase_02 | AC | 80 ms
42,156 KB |
testcase_03 | AC | 79 ms
42,120 KB |
testcase_04 | AC | 79 ms
42,148 KB |
testcase_05 | AC | 81 ms
42,396 KB |
testcase_06 | AC | 79 ms
41,936 KB |
testcase_07 | AC | 81 ms
42,056 KB |
testcase_08 | AC | 82 ms
42,056 KB |
testcase_09 | AC | 79 ms
42,160 KB |
testcase_10 | AC | 78 ms
42,008 KB |
testcase_11 | AC | 79 ms
42,444 KB |
testcase_12 | AC | 80 ms
42,328 KB |
testcase_13 | AC | 82 ms
42,124 KB |
testcase_14 | AC | 83 ms
42,180 KB |
testcase_15 | AC | 79 ms
42,112 KB |
ソースコード
import { readFileSync } from 'fs'; // Nはユキさんが度寝することを示します。 // Hはアラームが最初に鳴る時刻の、24時間制における時の値です。 // Mはアラームが最初に鳴る時刻の、分の値です。 // Tは最初にアラームが鳴った後、アラームが繰り返される間隔の、分単位の値です。 function Main(input: string) { const data = input.split('\n'); const firstLine = data[0].split(' ').map(Number); const N = firstLine[0]; const H = firstLine[1]; const M = firstLine[2]; const T = firstLine[3]; const delayMinutes = (N - 1) * T; const addHours = Math.floor(delayMinutes / 60); const addMinutes = delayMinutes % 60; let getUpHour = (H + addHours) % 24; let getUpMinutes = M + addMinutes; if (getUpMinutes > 60) { getUpHour++; getUpMinutes = getUpMinutes % 60; } if (getUpMinutes === 60) { getUpHour++; getUpMinutes = 0; } if (getUpHour === 24) { getUpHour = 0; } console.log(getUpHour); console.log(getUpMinutes); } Main(readFileSync('/dev/stdin', 'utf8'));