QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#874956#9381. 502 Bad GatewaywWA 300ms21816kbC++17620b2025-01-28 21:40:192025-01-28 21:40:21

Judging History

This is the latest submission verdict.

  • [2025-01-28 21:40:21]
  • Judged
  • Verdict: WA
  • Time: 300ms
  • Memory: 21816kb
  • [2025-01-28 21:40:19]
  • Submitted

answer

#include <iostream>
#include <vector>
#include <numeric> 
using namespace std;
int main() {
    int n;
    cin >> n;
    vector<pair<long long, long long>> results; 
    for (int i = 0; i < n; ++i) {
        long long T;
        cin >> T;
        long long numerator = T + 1; 
        long long denominator = 2; 
        long long g = gcd(numerator, denominator);
        numerator /= g;
        denominator /= g;
        results.emplace_back(numerator, denominator);
    }
    for (const auto& result : results) {
        cout << result.first << " " << result.second << "\n";
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3584kb

input:

3
1
2
3

output:

1 1
3 2
2 1

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 300ms
memory: 21816kb

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
1000000001 2
1 1
1 1
1000000001 2
1 1
1000000001 2
1 1
1 1
1 1
1000000001 2
1 1
1 1
1000000001 2
1 1
1000000001 2
1000000001 2
1 1
1000000001 2
1 1
1 1
1000000001 2
1 1
1000000001 2
1000000001 2
1 1
1000000001 2
1000000001 2
1000000001 2
1000000001 2
1000000001 2
1000000001 2
1 1
1 1
1000000001 ...

result:

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