結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2021-09-03 01:04:44 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 432 bytes |
コンパイル時間 | 2,092 ms |
コンパイル使用メモリ | 190,396 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 17:53:45 |
合計ジャッジ時間 | 2,442 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#define _GLIBCXX_DEBUG#include <bits/stdc++.h>using namespace std;int main() {vector<int> day = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};int ans = 0, month = 1, i = 1;while(month < 13){if(day[month] < i){month++;i = 1;continue;}int sum = 0, j = i;while(0 < j){sum += j%10;j /= 10;}if(month == sum) ans++;i++;}cout << ans << endl;}