結果

問題 No.188 HAPPY DAY
ユーザー hnthnt
提出日時 2016-03-28 15:07:37
言語 Java21
(openjdk 21)
結果
AC  
実行時間 171 ms / 1,000 ms
コード長 581 bytes
コンパイル時間 3,104 ms
コンパイル使用メモリ 71,752 KB
実行使用メモリ 55,868 KB
最終ジャッジ日時 2023-08-29 05:04:03
合計ジャッジ時間 3,849 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 171 ms
55,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Calendar;


public class no188 {
	public static void main(String[] args) {
		int cnt = 0;
		Calendar calendar = Calendar.getInstance();
		calendar.set(2015, 0, 1);
		while(true){
			int month = calendar.get(Calendar.MONTH)+1;
			int date = calendar.get(Calendar.DATE);
			int len = String.valueOf(date).length();
			if(len==1){
				if(month==date){
					cnt++;
				}
			}
			if(len==2){
				if(month==((date/10)+(date%10))){
					cnt++;
				}
			}
			if(month==12&&date==31){
				break;
			}
			calendar.add(Calendar.DATE,1);
		}
		System.out.println(cnt);

	}

}
0