結果
| 問題 |
No.2109 Special Week
|
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2022-10-28 21:32:08 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 1,877 bytes |
| コンパイル時間 | 3,372 ms |
| コンパイル使用メモリ | 184,332 KB |
| 最終ジャッジ日時 | 2025-02-08 14:08:59 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
#include <queue>
#include <string>
#include <iomanip>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <utility>
#include <stack>
#include <random>
#include <complex>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <assert.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
using namespace std;
using ll=long long;
#define read(x) cin>>(x);
#define readll(x) ll (x);cin>>(x);
#define readS(x) string (x);cin>>(x);
#define readvll(x,N) vector<ll> (x)((N));for(int i=0;i<(N);i++){cin>>(x)[i];}
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
#define rep2d(i,j,H,W) for(ll (i)=0;(i)<(H);(i)++)for(ll (j)=0;(j)<(W);j++)
#define is_in(x,y) (0<=(x) && (x)<H && 0<=(y) && (y)<W)
#define yn {cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}
#define double_out(x) fixed << setprecision(x)
template<class T> inline void erase_duplicate(vector<T>& A){sort(A.begin(),A.end());A.erase(unique(A.begin(),A.end()),A.end());}
inline ll powll(ll x,ll n){ll r=1;while(n>0){if(n&1){r*=x;};x*=x;n>>=1;};return r;}
inline ll endOfMonth(ll M){
if(M==1 || M==3 || M==5 || M==7 || M==8 || M==10 || M==12){
return 31;
}else if(M==2){
return 28;
}else{
return 30;
}
}
int main(){
ll M,D,K;
cin>>M>>D>>K;
unordered_set<ll> us;
for(ll i=0;i<7;i++){
if(M<10){
us.insert(0);
}else{
us.insert(1);
}
us.insert(M%10);
if(D<10){
us.insert(0);
}else if(D<20){
us.insert(1);
}else if(D<30){
us.insert(2);
}else{
us.insert(3);
}
us.insert(D%10);
if(endOfMonth(M)==D){
if(M==12){
M=1;
}else{
M++;
}
D=1;
}else{
D++;
}
}
if(us.size()>=K)yn;
}
harurun