QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#123793#6727. K-hour Clockisaunoya#WA 10ms3620kbC++14738b2023-07-13 17:24:552023-07-13 17:24:56

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-13 17:24:56]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:3620kb
  • [2023-07-13 17:24:55]
  • 提交

answer

#include <bits/stdc++.h>
#ifndef LOCAL
#define debug(...) 42
#endif
using namespace std;
template <typename T, typename T2> void cmin(T &x, const T2 &y) {
  if (x > y)
    x = y;
}
template <typename T, typename T2> void cmax(T &x, const T2 &y) {
  if (x < y)
    x = y;
}
using ll = long long;
mt19937 rng(time(NULL));
const int inf = 1000000000;
const ll lnf = 1000000000000000000;
#define sz(x) int((x).size())

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  int w = a + b - c;
  if (w <= a) {
    cout << -1 << "\n";
  } else {
    cout << w << "\n"; 
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}

详细

Test #1:

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

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: -100
Wrong Answer
time: 10ms
memory: 3472kb

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
591532918
-1
975114093
-1
-1
1105749596
398652704
639709137
1203184138
-1
1057591501
-1
847965981
-1
-1
-1
1229562136
797923156
-1
-1
-1
913981025
-1
-1
-1
1345234741
-1
1053306920
-1
-1
-1
-1
-1
-1
326906843
-1
-1
-1
-1
-1
133120806
241058758
1450926252
-1
-1
-1
-1
-1
-1
1068580042
489254...

result:

wrong answer Case #2: k <= z (x = 409013320, y = 825277663, z = 642758065, k = 591532918)