QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#858947#9675. 电池检测Aak5 1ms3584kbC++141.3kb2025-01-17 10:38:072025-01-17 10:38:07

Judging History

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

  • [2025-01-17 10:38:07]
  • 评测
  • 测评结果:5
  • 用时:1ms
  • 内存:3584kb
  • [2025-01-17 10:38:07]
  • 提交

answer

#ifdef ONLINE_JUDGE
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4.1,sse4.2,avx,avx2,popcnt")
#include <immintrin.h>
#include <emmintrin.h>
#endif
#include <bits/stdc++.h>

#define rep(i, a, b) for(int i = (a), i##end = (b); i <= i##end; i++)
#define _rep(i, a, b) for(int i = (a), i##end = (b); i >= i##end; i--)
#define ec first
#define fb second
#define dl make_pair
#define dk(...) make_tuple(__VA_ARGS__)
#define de(val) cerr << #val << " = " << (val) << endl

using namespace std;

typedef long long ll;
typedef __int128 i128;
typedef pair <int, int> pii;

int read() {
	int x = 0, f = 1; char c = getchar();
	while (!isdigit(c)) {
		if (c == '-') f = -1;
		c = getchar();
	}
	while (isdigit(c)) {
		x = (x << 3) + (x << 1) + (c ^ 48);
		c = getchar();
	}
	return x * f;
}

template <typename _Tp>
void print(_Tp x) {
	if (x < 0) putchar('-'), x = -x;
	static int sta[40];
	int top = 0;
	do sta[top++] = x % 10, x /= 10; while (x);
	while (top) putchar(sta[--top] + 48);
}

int T;

signed main() {
	T = read();
	while (T --> 0) {
		int a = read(), b = read();
		int ans = 0;
		rep (i, 1, b - 1) ans += a + b - i;
		if (a <= 2) ans += a + 1;
		else ans += 2;
		print(ans), puts("");
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 10
Accepted
time: 1ms
memory: 3584kb

input:

3
2 1
3 1
2 2

output:

3
2
6

result:

ok 3 number(s): "3 2 6"

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

12
2 1
2 2
2 3
2 4
3 1
3 2
3 3
3 4
4 1
4 2
4 3
4 4

output:

3
6
10
15
2
6
11
17
2
7
13
20

result:

wrong answer 6th numbers differ - expected: '4', found: '6'

Subtask #2:

score: 5
Accepted

Test #3:

score: 5
Accepted
time: 1ms
memory: 3584kb

input:

1000
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 17
2 18
2 19
2 20
2 21
2 22
2 23
2 24
2 25
2 26
2 27
2 28
2 29
2 30
2 31
2 32
2 33
2 34
2 35
2 36
2 37
2 38
2 39
2 40
2 41
2 42
2 43
2 44
2 45
2 46
2 47
2 48
2 49
2 50
2 51
2 52
2 53
2 54
2 55
2 56
2 57
2 58
2 59
2 60
2 61...

output:

3
6
10
15
21
28
36
45
55
66
78
91
105
120
136
153
171
190
210
231
253
276
300
325
351
378
406
435
465
496
528
561
595
630
666
703
741
780
820
861
903
946
990
1035
1081
1128
1176
1225
1275
1326
1378
1431
1485
1540
1596
1653
1711
1770
1830
1891
1953
2016
2080
2145
2211
2278
2346
2415
2485
2556
2628
27...

result:

ok 1000 numbers

Subtask #3:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 0ms
memory: 3584kb

input:

1000
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3 13
3 14
3 15
3 16
3 17
3 18
3 19
3 20
3 21
3 22
3 23
3 24
3 25
3 26
3 27
3 28
3 29
3 30
3 31
3 32
3 33
3 34
3 35
3 36
3 37
3 38
3 39
3 40
3 41
3 42
3 43
3 44
3 45
3 46
3 47
3 48
3 49
3 50
3 51
3 52
3 53
3 54
3 55
3 56
3 57
3 58
3 59
3 60
3 61...

output:

2
6
11
17
24
32
41
51
62
74
87
101
116
132
149
167
186
206
227
249
272
296
321
347
374
402
431
461
492
524
557
591
626
662
699
737
776
816
857
899
942
986
1031
1077
1124
1172
1221
1271
1322
1374
1427
1481
1536
1592
1649
1707
1766
1826
1887
1949
2012
2076
2141
2207
2274
2342
2411
2481
2552
2624
2697
...

result:

wrong answer 2nd numbers differ - expected: '4', found: '6'

Subtask #4:

score: 0
Wrong Answer

Test #5:

score: 0
Wrong Answer
time: 1ms
memory: 3584kb

input:

1000
907 241
495 435
227 139
616 1
433 35
588 407
533 322
995 961
748 310
212 36
968 500
294 187
375 371
307 14
648 180
122 28
304 253
818 812
41 5
286 62
573 340
547 224
347 35
279 56
151 85
626 410
456 248
578 470
11 6
952 771
404 302
77 27
168 40
524 517
171 147
407 294
268 106
100 27
549 196
973...

output:

246602
309227
40919
2
15319
321351
222776
1416482
279029
8052
607784
72077
207387
4084
132104
3674
108488
992666
176
19339
251879
146959
12395
16887
16256
339881
143262
381299
72
1029877
167057
2355
7334
403772
35699
162324
33707
2953
126167
431336
5744
179897
120629
27947
777862
1133367
563010
3153...

result:

wrong answer 1st numbers differ - expected: '242', found: '246602'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%

Subtask #6:

score: 0
Skipped

Dependency #5:

0%

Subtask #7:

score: 0
Skipped

Dependency #1:

0%