結果

問題 No.188 HAPPY DAY
ユーザー Yug_min_nullYug_min_null
提出日時 2021-09-03 01:04:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 432 bytes
コンパイル時間 2,195 ms
コンパイル使用メモリ 190,600 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-05-07 21:27:42
合計ジャッジ時間 2,399 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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;
}
0