QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#585040 | #9381. 502 Bad Gateway | Coffeecat996 | WA | 154ms | 3648kb | C++14 | 569b | 2024-09-23 18:33:35 | 2024-09-23 18:33:35 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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'