QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#585040#9381. 502 Bad GatewayCoffeecat996WA 154ms3648kbC++14569b2024-09-23 18:33:352024-09-23 18:33:35

Judging History

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

  • [2024-09-24 14:55:37]
  • hack成功,自动添加数据
  • (/hack/886)
  • [2024-09-23 18:33:35]
  • 评测
  • 测评结果:WA
  • 用时:154ms
  • 内存:3648kb
  • [2024-09-23 18:33:35]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long

inline void _solve () {
	int n;
	std::cin >> n;
	if (n % 2 == 1) {
		int a = n * n + 8 * n - 1;
		int b = 4 * n + 4;
		int c = std::__gcd (a, b);
		std::cout << a / c << " " << b / c << "\n"; 
	} else {
		int a = n * n + 10 * n;
		int b = 4 * n + 8; 
		int c = std::__gcd (a, b); 
		std::cout << a / c << " " << b / c << "\n"; 
	}
}
signed main () {
	std::ios::sync_with_stdio (false);
	std::cin.tie (0); std::cout.tie (0);
	int _T = 1;
	std::cin >> _T;
	while (_T--) _solve ();
	return 0;
} 


详细

Test #1:

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

input:

3
1
2
3

output:

1 1
3 2
2 1

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 154ms
memory: 3644kb

input:

1000000
1
1000000000
1
1
1000000000
1
1000000000
1
1
1
1000000000
1
1
1000000000
1
1000000000
1000000000
1
1000000000
1
1
1000000000
1
1000000000
1000000000
1
1000000000
1000000000
1000000000
1000000000
1000000000
1000000000
1
1
1000000000
1
1000000000
1000000000
1000000000
1000000000
1
1
1
10000000...

output:

1 1
125000001250000000 500000001
1 1
1 1
125000001250000000 500000001
1 1
125000001250000000 500000001
1 1
1 1
1 1
125000001250000000 500000001
1 1
1 1
125000001250000000 500000001
1 1
125000001250000000 500000001
125000001250000000 500000001
1 1
125000001250000000 500000001
1 1
1 1
1250000012500000...

result:

wrong answer 2nd lines differ - expected: '1999961560 44721', found: '125000001250000000 500000001'