QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#243091#6727. K-hour Clockgzzz#WA 0ms3580kbC++20479b2023-11-07 20:53:512023-11-07 20:53:51

Judging History

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

  • [2023-11-07 20:53:51]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3580kb
  • [2023-11-07 20:53:51]
  • 提交

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";
				}
			}
		}
	}
}

詳細信息

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)