結果
| 問題 | No.188 HAPPY DAY |
| コンテスト | |
| ユーザー |
r.suzuki
|
| 提出日時 | 2015-12-07 23:55:05 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 214 ms / 1,000 ms |
| コード長 | 652 bytes |
| コンパイル時間 | 3,902 ms |
| コンパイル使用メモリ | 74,044 KB |
| 実行使用メモリ | 41,512 KB |
| 最終ジャッジ日時 | 2024-12-30 20:50:18 |
| 合計ジャッジ時間 | 4,965 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
import java.util.Calendar;
public class No_188 {
public static void main(String[] args) {
Calendar calendar = Calendar.getInstance();
calendar.set(2015, 0, 1);
int year = calendar.get(Calendar.YEAR);
int HAPPY_DAY = 0;
while (year < 2016) {
int month = calendar.get(Calendar.MONTH) + 1;
int day = calendar.get(Calendar.DATE);
if (plusDate(month, day)) {
HAPPY_DAY++;
}
calendar.add(Calendar.DATE, 1);
year = calendar.get(Calendar.YEAR);
}
System.out.println(HAPPY_DAY);
}
static boolean plusDate(int month, int day) {
int plusDay = (day / 10) + (day % 10);
return month == plusDay ? true : false;
}
}
r.suzuki