社区讨论
40分wa的看过来!
P1567统计天数参与者 3已保存回复 5
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 5 条
- 当前快照
- 1 份
- 快照标识符
- @mi7ylt4t
- 此快照首次捕获于
- 2025/11/21 05:44 4 个月前
- 此快照最后确认于
- 2025/11/21 05:44 4 个月前
你们把数组再开大十倍就可以ac了~
(为什么出题人这么毒瘤呢)因为最优解是不用开数组的,出题人用心良苦来卡你们是为了让你们学到更多东西【逃】
下面是我的ac代码
CPP#include<iostream>
#include<cstdio>
using namespace std;
inline int read()
{
int x = 0, f = 1;
char c = getchar();
for (; !isdigit(c); c = getchar())
if (c == '-')
f = -1;
for (; isdigit(c); c = getchar())
x = (x << 3) + (x << 1) + c - '0';
return x * f;
}
int main()
{
int n=read(),ANS=1,ans=1,fir=-1;
for(register int i=1;i<=n;++i)
{
int tmp=read();
if(tmp>fir)fir=tmp,ans++,ANS=max(ANS,ans);
else ans=1,fir=tmp;
}
cout<<ANS;
return 0;
}
回复
共 5 条回复,欢迎继续交流。
正在加载回复...