来人,把我砍了(入门题最后一个样例死活过不去!!!)

P1567 统计天数

1~n改为~n+1
by _Harrisonwhl_ @ 2021-08-11 16:09:22


因为要不然持续到n的上升不会算入
by _Harrisonwhl_ @ 2021-08-11 16:09:54


循环
by _Harrisonwhl_ @ 2021-08-11 16:10:05


@[刺客阿柒](/user/297572) ```cpp #include<bits/stdc++.h> using namespace std; int ans=1,maxt,th=-0x7fffffff; int a[1000100]; int n; int main(){ cin>>n; ++n; for(int i=1;i<=n;i++){ cin>>a[i]; if(a[i]>th){ ans++; } else { if(ans>maxt) maxt=ans; ans=1; } th=a[i]; } cout<<maxt<<endl; } ```
by tZEROちゃん @ 2021-08-11 16:10:42


@[_Harrisonwhl_](/user/236514) 捕捉 whl /se
by Mysterious_Mini @ 2021-08-11 16:14:41


|