結果

問題 No.188 HAPPY DAY
ユーザー zangezange
提出日時 2016-01-13 18:15:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 606 bytes
コンパイル時間 639 ms
コンパイル使用メモリ 63,916 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-29 04:22:10
合計ジャッジ時間 937 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
	int x, y, day;
	int cnt = 0;
	for (int x = 1; x <= 12; x++) {
		switch (x) {
			case 1:
			case 3:
			case 5:
			case 7:
			case 8:
			case 10:
			case 12:
				day = 31;
				break;
			case 2:
				day = 28;
				break;
			case 4:
			case 6:
			case 9:
			case 11:
				day = 30;
				break;
			default:
				return 1;
		}

		for (int y = 1; y <= day; y++) {
			if (x == (y / 10 + y % 10)) {
				// cout << x << "月" << y << "日" << endl;
				cnt++;
			}
		}
	}
	cout << cnt << endl;

	return 0;
}
0