QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#754626#9381. 502 Bad GatewayYipChip#WA 0ms3632kbC++23454b2024-11-16 15:25:592024-11-16 15:26:08

Judging History

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

  • [2024-11-16 15:26:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3632kb
  • [2024-11-16 15:25:59]
  • 提交

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'