結果
| 問題 |
No.1242 高橋君とすごろく
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-02 22:00:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 593 bytes |
| コンパイル時間 | 1,937 ms |
| コンパイル使用メモリ | 194,704 KB |
| 最終ジャッジ日時 | 2025-01-15 00:17:45 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:22: warning: use of assignment suppression and length modifier together in gnu_scanf format [-Wformat=]
9 | int k; scanf("%*lld%d",&k);
| ^~~~~~~~~
main.cpp:9:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | int k; scanf("%*lld%d",&k);
| ~~~~~^~~~~~~~~~~~~~
main.cpp:11:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | rep(i,k) scanf("%lld",&a[i]), a[i]--;
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
using lint=long long;
int main(){
int k; scanf("%*lld%d",&k);
vector<lint> a(k);
rep(i,k) scanf("%lld",&a[i]), a[i]--;
rep(i,k) if(a[i]>=100) for(int j=i+1;j<k;j++) {
lint d=a[j]-a[i];
if(d==1 || d==3 || d==5){
puts("No");
return 0;
}
}
bool ng[200]={};
rep(i,k) if(a[i]<200) ng[a[i]]=true;
for(int x=190;x>=0;x--) if(!ng[x]) {
if(ng[x+1] && ng[x+6]) ng[x]=true;
if(ng[x+2] && ng[x+5]) ng[x]=true;
if(ng[x+3] && ng[x+4]) ng[x]=true;
}
puts(!ng[0]?"Yes":"No");
return 0;
}