专栏文章
P14292 题解
P14292题解参与者 1已保存评论 0
文章操作
快速查看文章及其快照的属性,并进行相关操作。
- 当前评论
- 0 条
- 当前快照
- 1 份
- 快照标识符
- @minj95c5
- 此快照首次捕获于
- 2025/12/02 03:19 3 个月前
- 此快照最后确认于
- 2025/12/02 03:19 3 个月前
思路
可以使用桶进行标记,标记所有 为
true。最后从 枚举到 ,看是否有满足 ,, 同时为 true 即可。AC CODE
CPP#include<bits/stdc++.h>
using namespace std;
int read(){int x=0;char f=1,ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9')x=x*10+ch-'0',ch=getchar();return x*f;}
const int N=2e5+10,E=2e5;
bool f[N];
int main(){
int n=read();
for(int i=1;i<=n;++i)
f[read()]=true;
for(int i=1;i<=E;++i)
if(f[i]&&f[i+3]&&f[i+6])
return printf("Yes\n"),0;
printf("No\n");
return 0;
}
相关推荐
评论
共 0 条评论,欢迎与作者交流。
正在加载评论...