QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#209077#4385. Randomucup-team1001WA 69ms3644kbC++14456b2023-10-10 09:24:282023-10-10 09:24:28

Judging History

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

  • [2023-10-10 09:24:28]
  • 评测
  • 测评结果:WA
  • 用时:69ms
  • 内存:3644kb
  • [2023-10-10 09:24:28]
  • 提交

answer

#include<bits/stdc++.h>
const int maxn=2e5+5;
const int mod=998244353;
long long pows(long long x,long long k)
{
	long long cnt=1;
	while(k){
		if(k&1){
			cnt*=x;
			cnt%=mod;
		}
		k>>=1;
		x*=x;
		x%=mod;
	}
}
int main()
{
	int t;
	std::cin>>t;
	while(t--){
		long long n,m;
		std::cin>>n>>m;
		if((n-m)%2==0){
			std::cout<<(n-m)/2<<std::endl;
		}
		else{
			std::cout<<(n-m)*pows(2,mod-2)<<std::endl;
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 69ms
memory: 3644kb

input:

100000
42 30
6335 1161
19170 15725
11479 6401
26963 24465
5706 5322
23282 16828
9962 492
2996 2955
4828 609
32392 14605
3903 154
293 77
17422 1295
19719 177
5448 5383
14772 11539
1870 1213
25668 632
17036 9895
28704 23812
31323 30334
17674 4665
15142 7712
28254 6869
25548 2097
32663 95
20038 12860
8...

output:

6
2587
1722
2539
1249
192
3227
4735
20
2109
8893
1874
108
8063
9771
32
1616
328
12518
3570
2446
494
6504
3715
10692
11725
16284
3589
3853
13375
4640
10174
119
49
7940
1820
4580
4510
6959
10422
3503
2065
3458
1278
777
725
6651
306
7018
3194
1361
1410
6387
5835
4643
693
3926
220
5602
1939
5348
4424
99...

result:

wrong answer 3rd lines differ - expected: '500001726', found: '1722'