結果

問題 No.188 HAPPY DAY
ユーザー spaciaspacia
提出日時 2015-12-16 20:02:47
言語 Java21
(openjdk 21)
結果
AC  
実行時間 46 ms / 1,000 ms
コード長 618 bytes
コンパイル時間 2,221 ms
コンパイル使用メモリ 71,436 KB
実行使用メモリ 49,448 KB
最終ジャッジ日時 2023-08-29 03:59:13
合計ジャッジ時間 3,090 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import java.io.*;
import java.util.*;
import java.math.*;

class Main188 {
	
	public static void out (Object o) {
		System.out.println(o);
	}
	
	public static int getSum (int n) {
		int ret = 0;
		while (n != 0) {
			ret += n % 10;
			n /= 10;
		}
		return ret;
	}
	
	public static void main (String[] args) throws IOException {
		BufferedReader br = 
			new BufferedReader(new InputStreamReader(System.in));
		
		int[] max = {0,31,28,31,30,31,30,31,31,30,31,30,31};
		int ans = 0;
		for (int m = 1; m < max.length; m++) {
			for (int d = 1; d <= max[m]; d++) {
				if (m == getSum(d)) ans++;
			}
		}
		out(ans);
	}
}
0