提交记录 8184
| 提交时间 |
评测时间 |
| 2019-01-31 19:31:08 |
2020-08-01 01:13:38 |
#include<iostream>
#include<cstdio>
using namespace std;
const int MAXN=100000+5;
int n;
int a[MAXN];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;++i){
scanf("%d",&a[i]);
}
unsigned long long cnt=0;
while(1){
unsigned long long s=0;
bool l0=0;
bool flag=1;
int i=1;
while(i<=n){
while(a[i]==0){
++i;
if(i>n)break;
}
if(i<=n){
++s;
while(a[i]!=0){
--a[i];
++i;
if(i>n)break;
}
}
}
cnt+=s;
if(s==0)break;
}
cout<<cnt<<'\n';
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 36.95 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 43.98 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 44.8 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 41.5 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 45.2 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 263.71 us | 44 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 1.003 ms | 48 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 21.613 ms | 84 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 1 s | 236 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
| Testcase #10 | 1 s | 424 KB | Time Limit Exceeded | Score: 0 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-07 06:35:26 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠