結果
問題 | No.188 HAPPY DAY |
ユーザー | intercept6 |
提出日時 | 2020-07-16 15:45:56 |
言語 | TypeScript (5.4.3) |
結果 |
AC
|
実行時間 | 62 ms / 1,000 ms |
コード長 | 9,673 bytes |
コンパイル時間 | 5,708 ms |
コンパイル使用メモリ | 146,468 KB |
実行使用メモリ | 39,424 KB |
最終ジャッジ日時 | 2024-11-24 21:51:00 |
合計ジャッジ時間 | 6,488 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ソースコード
type Calendar = { month: number; day: number; }; const calendar: Calendar[] = [ { month: 1, day: 1 }, { month: 1, day: 2 }, { month: 1, day: 3 }, { month: 1, day: 4 }, { month: 1, day: 5 }, { month: 1, day: 6 }, { month: 1, day: 7 }, { month: 1, day: 8 }, { month: 1, day: 9 }, { month: 1, day: 10 }, { month: 1, day: 11 }, { month: 1, day: 12 }, { month: 1, day: 13 }, { month: 1, day: 14 }, { month: 1, day: 15 }, { month: 1, day: 16 }, { month: 1, day: 17 }, { month: 1, day: 18 }, { month: 1, day: 19 }, { month: 1, day: 20 }, { month: 1, day: 21 }, { month: 1, day: 22 }, { month: 1, day: 23 }, { month: 1, day: 24 }, { month: 1, day: 25 }, { month: 1, day: 26 }, { month: 1, day: 27 }, { month: 1, day: 28 }, { month: 1, day: 29 }, { month: 1, day: 30 }, { month: 1, day: 31 }, { month: 2, day: 1 }, { month: 2, day: 2 }, { month: 2, day: 3 }, { month: 2, day: 4 }, { month: 2, day: 5 }, { month: 2, day: 6 }, { month: 2, day: 7 }, { month: 2, day: 8 }, { month: 2, day: 9 }, { month: 2, day: 10 }, { month: 2, day: 11 }, { month: 2, day: 12 }, { month: 2, day: 13 }, { month: 2, day: 14 }, { month: 2, day: 15 }, { month: 2, day: 16 }, { month: 2, day: 17 }, { month: 2, day: 18 }, { month: 2, day: 19 }, { month: 2, day: 20 }, { month: 2, day: 21 }, { month: 2, day: 22 }, { month: 2, day: 23 }, { month: 2, day: 24 }, { month: 2, day: 25 }, { month: 2, day: 26 }, { month: 2, day: 27 }, { month: 2, day: 28 }, { month: 3, day: 1 }, { month: 3, day: 2 }, { month: 3, day: 3 }, { month: 3, day: 4 }, { month: 3, day: 5 }, { month: 3, day: 6 }, { month: 3, day: 7 }, { month: 3, day: 8 }, { month: 3, day: 9 }, { month: 3, day: 10 }, { month: 3, day: 11 }, { month: 3, day: 12 }, { month: 3, day: 13 }, { month: 3, day: 14 }, { month: 3, day: 15 }, { month: 3, day: 16 }, { month: 3, day: 17 }, { month: 3, day: 18 }, { month: 3, day: 19 }, { month: 3, day: 20 }, { month: 3, day: 21 }, { month: 3, day: 22 }, { month: 3, day: 23 }, { month: 3, day: 24 }, { month: 3, day: 25 }, { month: 3, day: 26 }, { month: 3, day: 27 }, { month: 3, day: 28 }, { month: 3, day: 29 }, { month: 3, day: 30 }, { month: 3, day: 31 }, { month: 4, day: 1 }, { month: 4, day: 2 }, { month: 4, day: 3 }, { month: 4, day: 4 }, { month: 4, day: 5 }, { month: 4, day: 6 }, { month: 4, day: 7 }, { month: 4, day: 8 }, { month: 4, day: 9 }, { month: 4, day: 10 }, { month: 4, day: 11 }, { month: 4, day: 12 }, { month: 4, day: 13 }, { month: 4, day: 14 }, { month: 4, day: 15 }, { month: 4, day: 16 }, { month: 4, day: 17 }, { month: 4, day: 18 }, { month: 4, day: 19 }, { month: 4, day: 20 }, { month: 4, day: 21 }, { month: 4, day: 22 }, { month: 4, day: 23 }, { month: 4, day: 24 }, { month: 4, day: 25 }, { month: 4, day: 26 }, { month: 4, day: 27 }, { month: 4, day: 28 }, { month: 4, day: 29 }, { month: 4, day: 30 }, { month: 5, day: 1 }, { month: 5, day: 2 }, { month: 5, day: 3 }, { month: 5, day: 4 }, { month: 5, day: 5 }, { month: 5, day: 6 }, { month: 5, day: 7 }, { month: 5, day: 8 }, { month: 5, day: 9 }, { month: 5, day: 10 }, { month: 5, day: 11 }, { month: 5, day: 12 }, { month: 5, day: 13 }, { month: 5, day: 14 }, { month: 5, day: 15 }, { month: 5, day: 16 }, { month: 5, day: 17 }, { month: 5, day: 18 }, { month: 5, day: 19 }, { month: 5, day: 20 }, { month: 5, day: 21 }, { month: 5, day: 22 }, { month: 5, day: 23 }, { month: 5, day: 24 }, { month: 5, day: 25 }, { month: 5, day: 26 }, { month: 5, day: 27 }, { month: 5, day: 28 }, { month: 5, day: 29 }, { month: 5, day: 30 }, { month: 5, day: 31 }, { month: 6, day: 1 }, { month: 6, day: 2 }, { month: 6, day: 3 }, { month: 6, day: 4 }, { month: 6, day: 5 }, { month: 6, day: 6 }, { month: 6, day: 7 }, { month: 6, day: 8 }, { month: 6, day: 9 }, { month: 6, day: 10 }, { month: 6, day: 11 }, { month: 6, day: 12 }, { month: 6, day: 13 }, { month: 6, day: 14 }, { month: 6, day: 15 }, { month: 6, day: 16 }, { month: 6, day: 17 }, { month: 6, day: 18 }, { month: 6, day: 19 }, { month: 6, day: 20 }, { month: 6, day: 21 }, { month: 6, day: 22 }, { month: 6, day: 23 }, { month: 6, day: 24 }, { month: 6, day: 25 }, { month: 6, day: 26 }, { month: 6, day: 27 }, { month: 6, day: 28 }, { month: 6, day: 29 }, { month: 6, day: 30 }, { month: 7, day: 1 }, { month: 7, day: 2 }, { month: 7, day: 3 }, { month: 7, day: 4 }, { month: 7, day: 5 }, { month: 7, day: 6 }, { month: 7, day: 7 }, { month: 7, day: 8 }, { month: 7, day: 9 }, { month: 7, day: 10 }, { month: 7, day: 11 }, { month: 7, day: 12 }, { month: 7, day: 13 }, { month: 7, day: 14 }, { month: 7, day: 15 }, { month: 7, day: 16 }, { month: 7, day: 17 }, { month: 7, day: 18 }, { month: 7, day: 19 }, { month: 7, day: 20 }, { month: 7, day: 21 }, { month: 7, day: 22 }, { month: 7, day: 23 }, { month: 7, day: 24 }, { month: 7, day: 25 }, { month: 7, day: 26 }, { month: 7, day: 27 }, { month: 7, day: 28 }, { month: 7, day: 29 }, { month: 7, day: 30 }, { month: 7, day: 31 }, { month: 8, day: 1 }, { month: 8, day: 2 }, { month: 8, day: 3 }, { month: 8, day: 4 }, { month: 8, day: 5 }, { month: 8, day: 6 }, { month: 8, day: 7 }, { month: 8, day: 8 }, { month: 8, day: 9 }, { month: 8, day: 10 }, { month: 8, day: 11 }, { month: 8, day: 12 }, { month: 8, day: 13 }, { month: 8, day: 14 }, { month: 8, day: 15 }, { month: 8, day: 16 }, { month: 8, day: 17 }, { month: 8, day: 18 }, { month: 8, day: 19 }, { month: 8, day: 20 }, { month: 8, day: 21 }, { month: 8, day: 22 }, { month: 8, day: 23 }, { month: 8, day: 24 }, { month: 8, day: 25 }, { month: 8, day: 26 }, { month: 8, day: 27 }, { month: 8, day: 28 }, { month: 8, day: 29 }, { month: 8, day: 30 }, { month: 8, day: 31 }, { month: 9, day: 1 }, { month: 9, day: 2 }, { month: 9, day: 3 }, { month: 9, day: 4 }, { month: 9, day: 5 }, { month: 9, day: 6 }, { month: 9, day: 7 }, { month: 9, day: 8 }, { month: 9, day: 9 }, { month: 9, day: 10 }, { month: 9, day: 11 }, { month: 9, day: 12 }, { month: 9, day: 13 }, { month: 9, day: 14 }, { month: 9, day: 15 }, { month: 9, day: 16 }, { month: 9, day: 17 }, { month: 9, day: 18 }, { month: 9, day: 19 }, { month: 9, day: 20 }, { month: 9, day: 21 }, { month: 9, day: 22 }, { month: 9, day: 23 }, { month: 9, day: 24 }, { month: 9, day: 25 }, { month: 9, day: 26 }, { month: 9, day: 27 }, { month: 9, day: 28 }, { month: 9, day: 29 }, { month: 9, day: 30 }, { month: 10, day: 1 }, { month: 10, day: 2 }, { month: 10, day: 3 }, { month: 10, day: 4 }, { month: 10, day: 5 }, { month: 10, day: 6 }, { month: 10, day: 7 }, { month: 10, day: 8 }, { month: 10, day: 9 }, { month: 10, day: 10 }, { month: 10, day: 11 }, { month: 10, day: 12 }, { month: 10, day: 13 }, { month: 10, day: 14 }, { month: 10, day: 15 }, { month: 10, day: 16 }, { month: 10, day: 17 }, { month: 10, day: 18 }, { month: 10, day: 19 }, { month: 10, day: 20 }, { month: 10, day: 21 }, { month: 10, day: 22 }, { month: 10, day: 23 }, { month: 10, day: 24 }, { month: 10, day: 25 }, { month: 10, day: 26 }, { month: 10, day: 27 }, { month: 10, day: 28 }, { month: 10, day: 29 }, { month: 10, day: 30 }, { month: 10, day: 31 }, { month: 11, day: 1 }, { month: 11, day: 2 }, { month: 11, day: 3 }, { month: 11, day: 4 }, { month: 11, day: 5 }, { month: 11, day: 6 }, { month: 11, day: 7 }, { month: 11, day: 8 }, { month: 11, day: 9 }, { month: 11, day: 10 }, { month: 11, day: 11 }, { month: 11, day: 12 }, { month: 11, day: 13 }, { month: 11, day: 14 }, { month: 11, day: 15 }, { month: 11, day: 16 }, { month: 11, day: 17 }, { month: 11, day: 18 }, { month: 11, day: 19 }, { month: 11, day: 20 }, { month: 11, day: 21 }, { month: 11, day: 22 }, { month: 11, day: 23 }, { month: 11, day: 24 }, { month: 11, day: 25 }, { month: 11, day: 26 }, { month: 11, day: 27 }, { month: 11, day: 28 }, { month: 11, day: 29 }, { month: 11, day: 30 }, { month: 12, day: 1 }, { month: 12, day: 2 }, { month: 12, day: 3 }, { month: 12, day: 4 }, { month: 12, day: 5 }, { month: 12, day: 6 }, { month: 12, day: 7 }, { month: 12, day: 8 }, { month: 12, day: 9 }, { month: 12, day: 10 }, { month: 12, day: 11 }, { month: 12, day: 12 }, { month: 12, day: 13 }, { month: 12, day: 14 }, { month: 12, day: 15 }, { month: 12, day: 16 }, { month: 12, day: 17 }, { month: 12, day: 18 }, { month: 12, day: 19 }, { month: 12, day: 20 }, { month: 12, day: 21 }, { month: 12, day: 22 }, { month: 12, day: 23 }, { month: 12, day: 24 }, { month: 12, day: 25 }, { month: 12, day: 26 }, { month: 12, day: 27 }, { month: 12, day: 28 }, { month: 12, day: 29 }, { month: 12, day: 30 }, { month: 12, day: 31 }, ]; let count = 0; for (let i = 0; i < calendar.length; i++) { const { month, day } = calendar[i]; const isHappyDay = month === Math.floor((day / 10) % 10) + (day % 10); // process.stdout.write(`${month}/${day}: `); // process.stdout.write(`ten: ${Math.floor((day / 10) % 10)} `); // process.stdout.write(`one: ${day % 10} `); // process.stdout.write(String(isHappyDay)); // console.log(); if (isHappyDay) { count++; } } console.log(count);