QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#499361 | #6727. K-hour Clock | Railgun2334 | AC ✓ | 22ms | 3628kb | C++20 | 850b | 2024-07-31 13:20:30 | 2024-07-31 13:20:33 |
Judging History
answer
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <cstdio>
#include <cmath>
#define int long long
using namespace std;
const int N = 2e5 + 10, M = 1e6 + 10, MOD = 998244353;
int a[N];
typedef pair<int, int> PII;
void solove() {
int x, y, z;
cin >> x >> y >> z;
if (x + y < z) cout << "-1\n";
else if (x + y == z) cout << x + y + 5 << '\n';
else {
int t = x + y - z;
if (t <= x) cout << "-1\n";
else if ((x + y) % t == z) cout << t << '\n';
else cout << "-1\n";
}
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int TT = 1;
cin >> TT;
while (TT--) {
solove();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3628kb
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: 22ms
memory: 3584kb
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 253845968 975114093 -1 529926729 1105749596 -1 639709137 1203184138 -1 1057591501 673441987 847965981 -1 -1 643543527 1229562136 797923156 -1 488183715 524483174 913981025 -1 611749286 -1 1345234741 862956528 1053306920 -1 -1 410033104 -1 808528041 -1 326906843 970821151 433733585 -1 64...
result:
ok 100000 cases