QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#243091 | #6727. K-hour Clock | gzzz# | WA | 0ms | 3580kb | C++20 | 479b | 2023-11-07 20:53:51 | 2023-11-07 20:53:51 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf=2e9;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int t;cin>>t;
while(t--) {
ll x,y,z;
cin>>x>>y>>z;
x+=y;
if(x<z) {
cout<<"-1\n";
}
else if(x==z) {
cout<<inf<<"\n";
}
else {
ll cha=x-z;
if(cha<=z) {
cout<<"-1\n";
}
else {
if(x>=cha) {
cout<<"-1\n";
}
else {
cout<<cha<<"\n";
}
}
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3580kb
input:
4 11 18 5 3 49 4 1 9 1 1 3 10
output:
-1 -1 -1 -1
result:
wrong answer Case #1: Participant says impossible but a solution actually exists (x = 11, y = 18, z = 5, k = -1)