QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#644420#9381. 502 Bad GatewayScene#WA 111ms3840kbC++14430b2024-10-16 13:52:252024-10-16 13:52:27

Judging History

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

  • [2024-10-16 13:52:27]
  • 评测
  • 测评结果:WA
  • 用时:111ms
  • 内存:3840kb
  • [2024-10-16 13:52:25]
  • 提交

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'