結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2019-09-04 22:48:26 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 679 bytes |
コンパイル時間 | 2,039 ms |
コンパイル使用メモリ | 169,412 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-29 23:12:40 |
合計ジャッジ時間 | 2,466 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
/**@file 188.cpp@title No.188 HAPPY DAY - yukicoder@url https://yukicoder.me/problems/no/188**/#include <bits/stdc++.h>using namespace std;typedef long long LL;#define ALL(obj) (obj).begin(), (obj).end()#define REP(i, N) for (int i = 0; i < (N); ++i)int main() {vector<int> days = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int ans = 0;for (int month = 0; month < 12; month++) {for (int day = 1; day <= days[month]; day++) {int y = 0;REP(j, (int)to_string(day).size()) {y += stoi(to_string(day).substr(j, 1));}if (month+1 == y) {ans++;}}}cout << ans << endl;return 0;}