結果
問題 | No.188 HAPPY DAY |
ユーザー |
|
提出日時 | 2020-10-02 17:22:20 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,934 bytes |
コンパイル時間 | 1,875 ms |
コンパイル使用メモリ | 202,148 KB |
最終ジャッジ日時 | 2025-01-14 23:56:37 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll = long long;// --------------------------------------------------------template<class T> bool chmax(T& a, const T b) { if (a < b) { a = b; return 1; } return 0; }template<class T> bool chmin(T& a, const T b) { if (b < a) { a = b; return 1; } return 0; }#define FOR(i,l,r) for (int i = (l); i < (r); ++i)#define REP(i,n) FOR(i,0,n)#define ALL(c) (c).begin(), (c).end()#define RALL(c) (c).rbegin(), (c).rend()#define SORT(c) sort(ALL(c))#define RSORT(c) sort(RALL(c))#define MIN(c) *min_element(ALL(c))#define MAX(c) *max_element(ALL(c))#define SUM(c) accumulate(ALL(c), 0)#define SUMLL(c) accumulate(ALL(c), 0LL)#define SZ(c) ((int)(c).size())#define debug(x) cerr << #x << " = " << (x) << '\n';using P = pair<int,int>;using VP = vector<P>;using VVP = vector<VP>;using VS = vector<string>;using VI = vector<int>;using VVI = vector<VI>;using VLL = vector<ll>;using VVLL = vector<VLL>;using VB = vector<bool>;using VVB = vector<VB>;using VD = vector<double>;using VVD = vector<VD>;static const double EPS = 1e-10;static const double PI = acos(-1.0);static const ll MOD = 1000000007;// static const ll MOD = 998244353;static const int INF = 1 << 30;// static const ll INF = 1LL << 62;// --------------------------------------------------------// #include <atcoder/all>// using namespace atcoder;int main() {ios::sync_with_stdio(false);cin.tie(0);cout << fixed << setprecision(10);map<int,int> cal = {{1, 31}, {2, 28}, {3, 31}, {4, 30},{5, 31}, {6, 30}, {7, 31}, {8, 31},{9, 30}, {10, 31}, {11, 30}, {12, 31},};int ans = 0;FOR(month,1,13) {FOR(d,1,cal[month]) {string day = to_string(d);int sum = 0;REP(i,SZ(day)) sum += (day[i] - '0');if (month == sum) ans++;}}cout << ans << '\n';return 0;}