QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#243100#6727. K-hour Clockgzzz#AC ✓23ms3636kbC++20494b2023-11-07 21:00:522023-11-07 21:00:52

Judging History

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

  • [2023-11-07 21:00:52]
  • 评测
  • 测评结果:AC
  • 用时:23ms
  • 内存:3636kb
  • [2023-11-07 21:00:52]
  • 提交

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;
		ll ori=x;
		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(ori>=cha) {
					cout<<"-1\n";
				}
				else {
					cout<<cha<<"\n";
				}
			}
		}
	}
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3580kb

input:

4
11 18 5
3 49 4
1 9 1
1 3 10

output:

24
48
9
-1

result:

ok 4 cases

Test #2:

score: 0
Accepted
time: 23ms
memory: 3636kb

input:

100000
186826504 580942638 34507146
409013320 825277663 642758065
221040339 32805624 253845963
759538401 529610463 314034771
591738614 223935926 591499221
272890462 257036262 529926724
644722795 540369561 79342760
141738127 915104743 658190166
378771709 735410115 474472687
550207480 676282297 233056...

output:

733261996
-1
2000000000
975114093
-1
2000000000
1105749596
-1
639709137
1203184138
-1
1057591501
2000000000
847965981
-1
-1
2000000000
1229562136
797923156
-1
2000000000
2000000000
913981025
-1
2000000000
-1
1345234741
2000000000
1053306920
-1
-1
2000000000
-1
2000000000
-1
326906843
2000000000
2000...

result:

ok 100000 cases