結果

問題 No.188 HAPPY DAY
ユーザー mayo031042mayo031042
提出日時 2021-04-20 13:10:48
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 1,699 bytes
コンパイル時間 1,407 ms
コンパイル使用メモリ 163,796 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-09-17 08:39:17
合計ジャッジ時間 1,761 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
// #include <atcoder/all>
// #include "icld.cpp"
using namespace std;
using ll = long long int;
using vi = vector<int>;
using si = set<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using ss = string;
using db = double;
template<typename T> using minpq = priority_queue <T,vector<T>,greater<T>>;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
#define V vector
#define P pair<int,int>
#define PLL pair<ll,ll>
#define rep(i,s,n) for(int i=(s);i<(int)(n);i++)
#define rev(i,s,n) for(int i=(s);i>=(int)(n);i--)
#define reciv(v,n) vll (v)((n)); rep(i,0,(n))cin>>v[i]
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define ci(x) cin >> x
#define cii(x) ll x;cin >> x
#define cci(x,y) ll x,y;cin >> x >> y
#define co(x) cout << x << endl
#define pb push_back
#define eb emplace_back
#define rz resize
#define pu push
#define sz(x) int(x.size())
#define vij v[i][j]
// ll p = 1e9+7;
// ll p = 998244353;
// n do -> n*pi/180
#define yn cout<<"Yes"<<endl;else cout<<"No"<<endl
#define YN cout<<"YES"<<endl;else cout<<"NO"<<endl
template<class T>void chmax(T &x,T y){x=max(x,y);}
template<class T>void chmin(T &x,T y){x=min(x,y);}

int uru(int y){return 0;}

void nxday(int &y,int &m,int &d){
  if(m==2){
    if(d>=28){  
      if(d==28&&uru(y))d=29;
      else {m=3;d=1;}
    }
    else d++;
  }
  else if(m==1||m==3||m==5||m==7||m==8||m==10||m==12){
    if(d==31){
      d=1;
      if(m==12){y++;m=1;}
      else m++;
    }
    else d++;
  }
  else if(d==30){
    m++;d=1;
  }
  else d++;
}
int main(){
  int y=2015,m=1,d=1;

  int ans=0;
  while(y==2015){
    int D=d/10+d%10;
    if(m==D)ans++;
    nxday(y,m,d);
  }

  co(ans);
}
0