QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#499444#6727. K-hour ClockpagohiaWA 0ms3556kbC++141.0kb2024-07-31 14:18:492024-07-31 14:18:49

Judging History

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

  • [2024-07-31 14:18:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3556kb
  • [2024-07-31 14:18:49]
  • 提交

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;

}

详细

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)