QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#535763#7695. Double Uprotcar07WA 0ms3692kbC++14619b2024-08-28 14:26:372024-08-28 14:26:37

Judging History

你现在查看的是最新测评结果

  • [2024-08-28 14:26:37]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3692kb
  • [2024-08-28 14:26:37]
  • 提交

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'