結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2017-03-07 21:46:23 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 54 ms / 1,000 ms |
コード長 | 823 bytes |
コンパイル時間 | 4,180 ms |
コンパイル使用メモリ | 74,296 KB |
実行使用メモリ | 49,744 KB |
最終ジャッジ日時 | 2024-12-31 01:24:17 |
合計ジャッジ時間 | 4,283 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
public class No188 {public static void main(String[] args) {int[] days = new int[31];for (int i = 1; i <= 31; i++) {if (i < 10) {days[i - 1] = i;} else {days[i - 1] = ((i - (i % 10)) / 10) + (i % 10);}}int cnt = 0;for (int i = 1; i <= 12; i++) {int cntMax = 0;if (i == 2) {cntMax = 28;} else if (i == 2 || i == 4 || i == 6 || i == 9 || i == 11) {cntMax = 30;} else {cntMax = 31;}for (int j = 1; j <= cntMax; j++) {if (i == days[j - 1]) {cnt++;}}}System.out.println(cnt);}}