QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#123099#6727. K-hour ClocklhzawaAC ✓25ms3672kbC++14690b2023-07-11 18:55:412023-07-11 18:55:42

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-11 18:55:42]
  • 评测
  • 测评结果:AC
  • 用时:25ms
  • 内存:3672kb
  • [2023-07-11 18:55:41]
  • 提交

answer

// Problem: F. K-hour Clock
// Contest: QOJ - The 2019 ICPC China Shaanxi Provincial Programming Contest
// URL: https://qoj.ac/contest/1285/problem/6727
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
int main() {
	function<void ()> solve = []() -> void {
		int x, y, z;
		scanf("%d%d%d", &x, &y, &z);
		int k = x + y - z;
		if (k < 0) {
			printf("-1\n");
		}
		else if (k == 0) {
			printf("%d\n", (int)(2e9));
		}
		else {
			printf("%d\n", (k > x && k > z ? k : -1));
		}
		return ;
	};
	int _;
	scanf("%d", &_);
	for (; _; _--) {
		solve();
	}
	return 0;
}

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3672kb

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: 25ms
memory: 3656kb

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