QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#535763 | #7695. Double Up | rotcar07 | WA | 0ms | 3692kb | C++14 | 619b | 2024-08-28 14:26:37 | 2024-08-28 14:26:37 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef __int128 LL;
inline void print(LL x){
if(x>=10) print(x/10);
putchar(x%10+'0');
}
template<typename T>inline void readmain(T&x){x=0;char ch;int f=1;while(!isdigit(ch=getchar()))if(ch=='-')f=-1;do x=x*10+(ch^48);while(isdigit(ch=getchar()));x*=f;}
template<typename T> inline void read(T&x){readmain(x);}
template<typename T,typename ...Tr> inline void read(T&x,Tr&...r){readmain(x);read(r...);}
int main(){
int n;cin>>n;
LL sum=0,x=0;
for(int i=1;i<=n;i++) read(x),sum+=x;
while(sum&-sum!=sum) sum-=sum&-sum;
print(sum);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3692kb
input:
5 4 2 2 1 8
output:
16
result:
ok single line: '16'
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3648kb
input:
1000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1...
output:
1000
result:
wrong answer 1st lines differ - expected: '512', found: '1000'