QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#499444 | #6727. K-hour Clock | pagohia | WA | 0ms | 3556kb | C++14 | 1.0kb | 2024-07-31 14:18:49 | 2024-07-31 14:18:49 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 2e9;
const int M = 5e4 + 10;
typedef long long ll;
typedef double db;
typedef pair<int, int>pii;
typedef pair<long, long>pll;
int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
inline long long read()
{
long long w = 1;
long long q = 0;
char ch = ' ';
while (ch != '-' && (ch < '0' || ch>'9')) ch = getchar();
if (ch == '-') w = -1, ch = getchar();
while (ch >= '0' && ch <= '9')
q = q * 10 + ch - '0', ch = getchar();
return w * q;
}
void solve()
{
long long x, y, z;
cin >> x >> y >> z;
long long sum = x+y-z;
cout << sum << " " << z << endl;
if (sum == 0)
{
cout << z + 1;
}
else if (sum < z)
{
cout << -1<< endl;
}
else if (sum < 0)
{
cout << -1 << endl;
return;
}
else
{
cout << sum << endl;
return;
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int tcase = 1;
cin >> tcase;
while (tcase--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3556kb
input:
4 11 18 5 3 49 4 1 9 1 1 3 10
output:
24 5 24 48 4 48 9 1 9 -6 10 -1
result:
wrong answer Case #2: x + y != z (mod k) (x = 3, y = 49, z = 4, k = 5)