QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#623987#9381. 502 Bad GatewayPatrick_StarWA 459ms3624kbC++23300b2024-10-09 14:36:112024-10-09 14:36:11

Judging History

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

  • [2024-10-09 14:36:11]
  • 评测
  • 测评结果:WA
  • 用时:459ms
  • 内存:3624kb
  • [2024-10-09 14:36:11]
  • 提交

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";
    }
}

詳細信息

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'