QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#623987 | #9381. 502 Bad Gateway | Patrick_Star | WA | 459ms | 3624kb | C++23 | 300b | 2024-10-09 14:36:11 | 2024-10-09 14:36:11 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
int main(){
int n;
cin>>n;
int t;
while(n--){
cin>>t;
long long first = t*(t+1)/2;
long long second = t;
int gcd = __gcd(first,second);
cout<<first/gcd<<" "<<second/gcd<<"\n";
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3612kb
input:
3 1 2 3
output:
1 1 3 2 2 1
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 459ms
memory: 3624kb
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 -950427 3906250 1 1 1 1 -950427 3906250 1 1 -950427 3906250 1 1 1 1 1 1 -950427 3906250 1 1 1 1 -950427 3906250 1 1 -950427 3906250 -950427 3906250 1 1 -950427 3906250 1 1 1 1 -950427 3906250 1 1 -950427 3906250 -950427 3906250 1 1 -950427 3906250 -950427 3906250 -950427 3906250 -950427 3906250 ...
result:
wrong answer 2nd lines differ - expected: '1999961560 44721', found: '-950427 3906250'