結果
問題 | No.188 HAPPY DAY |
ユーザー | kurobei72 |
提出日時 | 2018-01-18 21:11:49 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 171 ms / 1,000 ms |
コード長 | 910 bytes |
コンパイル時間 | 3,428 ms |
コンパイル使用メモリ | 72,112 KB |
実行使用メモリ | 57,340 KB |
最終ジャッジ日時 | 2023-08-30 01:52:40 |
合計ジャッジ時間 | 3,862 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge11 |
(要ログイン)
ソースコード
import java.util.GregorianCalendar; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(System.in); //int a = sc.nextInt(); //int b = sc.nextInt(); GregorianCalendar calendar = new GregorianCalendar(2015, 0, 31); GregorianCalendar endDay = new GregorianCalendar(2015, 11, 31); int count = 0; int d10 = 0; int d1 = 0; for (int i = 1; i <= 365; i++ ) { int m = calendar.get(calendar.MONTH); int d = calendar.get(calendar.DATE); if (d > 9) { d10 = d/10; d1 = d%10; } else { d1 = d; } if (m == d10 + d1) { count++; } calendar.add(calendar.DATE, 1); } System.out.println(count); } }