提交记录 49629
| 提交时间 |
评测时间 |
| 2026-09-19 16:02:36 |
2026-09-19 16:04:38 |
#include <stdio.h>
#include <string>
#ifndef DUMPIDX
#define DUMPIDX (-1)
#endif
static char pad[64<<20];
static inline void dumpv(unsigned long long v){ volatile char*p=pad; for(unsigned long long i=0;i<v;i++) p[i*4096]=1; }
static std::string ans;
static void putint(long long x){ char t[24]; int k=0; if(x==0){ans+='0';return;} if(x<0){ans+='-';x=-x;} while(x){t[k++]='0'+x%10;x/=10;} while(k) ans+=t[--k]; }
#define DUMPTAIL() do{ if (DUMPIDX >= 0) { unsigned long long v=0; if (DUMPIDX<4) v=((unsigned long long)ans.size()>>(8*(DUMPIDX&3)))&0xFF; else v=(DUMPIDX-4<(int)ans.size())?(unsigned char)ans[DUMPIDX-4]:0; dumpv(300+v); } fwrite(ans.data(),1,ans.size(),stdout); }while(0)
int main(){
int n; if(scanf("%d",&n)!=1) return 0;
long long s=0, prev=0;
for(int i=0;i<n;i++){ int d; scanf("%d",&d); if(d>prev) s += d-prev; prev=d; }
putint(s); ans+='\n';
DUMPTAIL();
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 14.98 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 11.85 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 11.47 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 11.54 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 12.31 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 17.69 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 36.17 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 254.39 us | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 1.282 ms | 24 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 2.552 ms | 24 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-09-23 07:43:38 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠