QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#691835#9296. Golden SpiritBlizzardWA 3ms3636kbC++23515b2024-10-31 13:10:392024-10-31 13:10:47

Judging History

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

  • [2024-10-31 13:10:47]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3636kb
  • [2024-10-31 13:10:39]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	int t;
	cin >> t;
	while(t--)
	{
		int n , x , m;
		cin >> n >> x >> m;
		int nowt = m * 2 * n;
		if(x <= nowt - 2 * m)
		{
			cout << nowt * 2 << '\n';
			continue;
		}
		else
		{
			int t1 ,t2;
			t1 = x - nowt + 2 * m + 2 * nowt;
			t2 = m + max( 0 , x - nowt) + 2 * nowt;
			cout << min( t1 , t2 ) << '\n';
//			cout << t1 << ' ' << t2 << '\n';
		}
	}
	
	return 0;
} 

 

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

3
2 2 2
3 1 10
11 45 14

output:

16
120
616

result:

ok 3 lines

Test #2:

score: -100
Wrong Answer
time: 3ms
memory: 3636kb

input:

10000
3050395 689380 200550
5885929 822329 269033
6682339 28476 346976
9571342 934182 89292
9928491 668975 401621
6524373 173981 202472
5331629 482403 456644
9661686 231207 298636
5454412 961564 632648
5186684 9125 590489
8036028 738212 913802
1211903 553317 790831
6044436 222947 254859
2202128 6558...

output:

-551354930
-1040214972
-1341790500
-107420606
-772230254
1201626144
-1179188465
-1780995389
-565164508
1472665712
-2109583394
-1763949756
-1362411664
-296023122
-2028507480
-625005902
2136220744
-807648048
-1528673113
74466060
801811348
157894424
-1802708872
-1509974301
-2136827600
-47449200
-186762...

result:

wrong answer 1st lines differ - expected: '2447026869000', found: '-551354930'