QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#499441 | #6727. K-hour Clock | buzhijingdi | WA | 0ms | 3648kb | C++14 | 591b | 2024-07-31 14:17:04 | 2024-07-31 14:17:06 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N = 2e5 + 9;
const int mod = 1e9 + 7;
#define eps 1e-5
#define inf 2e18
ll a, b, c;
void solve()
{
cin >> a >> b >> c;
ll k = a + b - c;
if (k < 0)
{
cout << "-1" << '\n';
return;
}
else if (k == 0) {
cout << a + b + 1 << endl;
}
else {
cout << k*k << '\n';
}
}
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int _ = 1; cin >> _;
while (_--) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3648kb
input:
4 11 18 5 3 49 4 1 9 1 1 3 10
output:
576 2304 81 -1
result:
wrong answer Case #1: x + y != z (mod k) (x = 11, y = 18, z = 5, k = 576)