結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
toame2073
|
| 提出日時 | 2018-02-22 19:23:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 1,000 ms |
| コード長 | 925 bytes |
| コンパイル時間 | 1,602 ms |
| コンパイル使用メモリ | 157,792 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-02 08:29:52 |
| 合計ジャッジ時間 | 1,839 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x) cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
int day(int a, int b) {
int B = 0;
while(b > 0) {
B += b % 10;
b /= 10;
}
if (a == B) return 1;
else return 0;
}
int month(int a, int b) {
int cnt = 0;
rep(i, b) cnt += day(a, i+1);
return cnt;
}
int main(void)
{
cin.tie(0);
ios::sync_with_stdio(false);
int cnt = 0;
cnt += month(1, 31);
cnt += month(2, 28);
cnt += month(3, 31);
cnt += month(4, 30);
cnt += month(5, 31);
cnt += month(6, 30);
cnt += month(7, 31);
cnt += month(8, 31);
cnt += month(9, 30);
cnt += month(10, 31);
cnt += month(11, 30);
cnt += month(12, 31);
cout << cnt << endl;
return 0;
}
toame2073