結果

問題 No.188 HAPPY DAY
ユーザー masamasa
提出日時 2015-04-22 22:08:41
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 515 bytes
コンパイル時間 478 ms
コンパイル使用メモリ 60,448 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-29 01:54:31
合計ジャッジ時間 910 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>

using namespace std;

const int SIZE = 13;
const int days[SIZE] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

int calc(int n) {
	return n / 10 + n % 10;
}

int main() {
	int happy = 0;

	for (int i = 1; i < SIZE; i++) {
		int val_m = calc(i);
		for (int j = 1; j <= days[i]; j++) {
			if (calc(j) == val_m) {
				happy++;
				// printf("%02d/%02d\n", i, j);
			}
		}
	}

	cout << happy << endl;
	return 0;
}
0