結果

問題 No.188 HAPPY DAY
ユーザー fushigufushigu
提出日時 2019-05-17 09:41:48
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 577 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 64,160 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 07:13:25
合計ジャッジ時間 919 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
using ll = long long;

int main()
{
	int ans = 0;
	for (int i = 1; i <= 12; i++)
	{
		int day = 0;
		switch (i)
		{
		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:
			break;
		}
		for (int j = 1; j < day + 1; j++)
		{
			if (j % 10 + floor(j / 10) == i)
			{
				ans++;
			}
		}
	}
	cout << ans << endl;
}
0