結果

問題 No.188 HAPPY DAY
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-08 21:53:38
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 831 bytes
コンパイル時間 4,877 ms
コンパイル使用メモリ 77,076 KB
実行使用メモリ 57,476 KB
最終ジャッジ日時 2023-10-26 03:53:54
合計ジャッジ時間 5,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.util.*;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int count = 0;
		for (int i=1; i<=12; i++) {
			if (i==2) { //-28
				for (int j=1; j<=28; j++) {
					int temp = 0;
					if (j>=10) {
						temp = j/10 + j%10;
					}
					else {
						temp = j;
					}
					if (i==temp) {count++;}
				}
			}
			else if (i==4 || i==6 || i==9 || i==11) { //-30
				for (int j=1; j<=30; j++) {
					int temp = 0;
					if (j>=10) {
						temp = j/10 + j%10;
					}
					else {
						temp = j;
					}
					if (i==temp) {count++;}
				}
			}
			else { //-31
				for (int j=1; j<=31; j++) {
					int temp = 0;
					if (j>=10) {
						temp = j/10 + j%10;
					}
					else {
						temp = j;
					}
					if (i==temp) {count++;}
				}
			}
		}
		System.out.println(count);
	}
}
0