提交记录 7971
| 提交时间 |
评测时间 |
| 2019-01-26 15:14:03 |
2020-08-01 01:11:13 |
#include<bits/stdc++.h>
using namespace std;
inline int getint(){
int ans=0;
char c=getchar();
while(c<'0'||c>'9')c=getchar();//' '<'0'
while(c>='0'&&c<='9'){
ans*=10;
ans+=c-'0';
c=getchar();
}
return ans;
}
int main(){
int n=getint();
register int lst=0,ans=0,x;
for(register int i=n;i;--i){
x=getint();
ans+=((x-lst)&-(0<x-lst));//Is it faster?
lst=x;
}
printf("%d",ans);
return 0;
}
| Compilation | N/A | N/A | Compile OK | Score: N/A | 显示更多 |
| Testcase #1 | 32.98 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #2 | 32.92 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #3 | 33.41 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #4 | 33.26 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #5 | 41.8 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #6 | 34.89 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #7 | 44.57 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #8 | 142.93 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #9 | 667.99 us | 36 KB | Accepted | Score: 10 | 显示更多 |
| Testcase #10 | 1.304 ms | 36 KB | Accepted | Score: 10 | 显示更多 |
Judge Duck Online | 评测鸭在线
Server Time: 2026-04-07 14:33:46 | Loaded in 1 ms | Server Status
个人娱乐项目,仅供学习交流使用 | 捐赠