結果

問題 No.188 HAPPY DAY
コンテスト
ユーザー Tsukasa_Type
提出日時 2018-02-08 21:53:38
言語 Java
(openjdk 26.0.2.1 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 56 ms / 1,000 ms
+ 490µs
コード長 831 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,428 ms
コンパイル使用メモリ 84,180 KB
実行使用メモリ 44,156 KB
最終ジャッジ日時 2026-09-04 02:16:53
合計ジャッジ時間 2,792 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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