QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#228028 | #7632. Balanced Arrays | ucup-team958# | WA | 1ms | 3336kb | C++17 | 512b | 2023-10-28 10:47:27 | 2023-10-28 10:47:28 |
Judging History
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'