結果

問題 No.188 HAPPY DAY
ユーザー tancahn2380tancahn2380
提出日時 2017-09-12 20:14:39
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 750 bytes
コンパイル時間 1,072 ms
コンパイル使用メモリ 84,324 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-30 01:26:52
合計ジャッジ時間 1,212 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
using namespace std;
using LL = long long;
constexpr int MOD = 1000000000 + 7;
//足し算してオーバーフローで死なないように確認しようね
constexpr int INF = 1000000000;
const double PI = acos(-1);

int main() {
	int ans = 0;
	for (int i = 1; i <= 12; i++) {
		int month = 31;
		if (i == 2) month = 28;
		if (i == 4 || i == 6 || i == 9 || i == 11) month = 30;
		for (int j = 1; j <= month; j++) {
			int sum = j / 10 + j % 10;
			if (i == sum) ans++;
		}
	}
	cout << ans << endl;
}
0