QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#754626 | #9381. 502 Bad Gateway | YipChip# | WA | 0ms | 3632kb | C++23 | 454b | 2024-11-16 15:25:59 | 2024-11-16 15:26:08 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
typedef long long ll;
void solve()
{
int n;
cin >> n;
ll t = sqrt(n << 1);
ll u = (t - 1) * t + 2 * n;
ll d = 2 * u;
cout << u / __gcd(u, d) << " " << d / __gcd(u, d) << "\n";
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr), cout.tie(nullptr);
int T = 1;
cin >> T;
while (T -- ) solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3632kb
input:
3 1 2 3
output:
1 2 1 2 1 2
result:
wrong answer 1st lines differ - expected: '1 1', found: '1 2'