結果
| 問題 |
No.2109 Special Week
|
| コンテスト | |
| ユーザー |
sorag
|
| 提出日時 | 2022-10-28 22:32:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,326 bytes |
| コンパイル時間 | 1,227 ms |
| コンパイル使用メモリ | 122,708 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 01:44:50 |
| 合計ジャッジ時間 | 2,326 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 37 |
ソースコード
#include <iostream>
#include<random>
#include<utility>
#include <vector>
#include <regex>
#include <map>
#include<string>
#include<queue>
#include<math.h>
#include<set>
#include<cstring>
#include<algorithm>
#define pb push_back
#define all(x) begin(x),end(x)
#define gall(x) begin(x),end(x),greater<>()
#define ll long long
#define P pair<int,int>
#define lP pair<ll,ll>
#define bit(x,i) (x>>i&1)
using namespace std;
int main(){
vector<int> g(32);
int m,d,k;
cin>>m>>d>>k;
g[m]++;
g[d]++;
set<char> st;
for(int i=d;i<d+7;i++){
if(m==1 or m==3 or m==5 or m==7 or m==8 or
m==10 or m==12) {
if(i>=32) {
g[(m+1)%12]++;
g[i%31]++;
}
else g[i]++;
}
else if(m==4 or m==6 or m==9 or m==11){
if(i>=31){
g[m+1]++;
g[i%30]++;
}
else g[i]++;
}
else{
if(i>=29){
g[m+1]++;
g[i%28]++;
}
else g[i]++;
}
}
for(int i=1;i<=31;i++){
if(g[i]>0){
st.insert((char)i/10+48);
st.insert((char)i%10+48);
}
}
if(st.size()>=k) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}
sorag