QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#228028#7632. Balanced Arraysucup-team958#WA 1ms3336kbC++17512b2023-10-28 10:47:272023-10-28 10:47:28

Judging History

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

  • [2023-10-28 10:47:28]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3336kb
  • [2023-10-28 10:47:27]
  • 提交

answer

//Man always remember love because of romance only!
#include<bits/stdc++.h>
using namespace std;
inline int read(){
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}
inline void write(int x){
    if(x<0) putchar('-'),x=-x;
    if(x>9) write(x/10);
    putchar(x%10+'0');
}
int main(){
    int l=read(),r=read();
    if(l+1==r) puts("-1");
    else cout<<(l+r+1)/2;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3336kb

input:

2 2

output:

2

result:

wrong answer 1st numbers differ - expected: '9', found: '2'