QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#644420 | #9381. 502 Bad Gateway | Scene# | WA | 111ms | 3840kb | C++14 | 430b | 2024-10-16 13:52:25 | 2024-10-16 13:52:27 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int read(){
int ret=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-f;ch=getchar();}
while( isdigit(ch)){ret=(ret<<3)+(ret<<1)+(ch&15);ch=getchar();}
return ret*f;
}
int T;
int n;
int main(){
T=read();
while(T--){
n=read();
long long a=1ll*(n/2+1)*(n/2+2)/2+n-(n/2)-1,b=(n/2)+1;
printf("%lld %lld\n",a/__gcd(a,b),b/__gcd(a,b));
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3840kb
input:
3 1 2 3
output:
1 1 3 2 2 1
result:
ok 3 lines
Test #2:
score: -100
Wrong Answer
time: 111ms
memory: 3764kb
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 125000001250000000 500000001 1 1 1 1 125000001250000000 500000001 1 1 125000001250000000 500000001 1 1 1 1 1 1 125000001250000000 500000001 1 1 1 1 125000001250000000 500000001 1 1 125000001250000000 500000001 125000001250000000 500000001 1 1 125000001250000000 500000001 1 1 1 1 1250000012500000...
result:
wrong answer 2nd lines differ - expected: '1999961560 44721', found: '125000001250000000 500000001'