QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#268615#7840. Assessment Disruptionmshcherba#AC ✓1ms3560kbC++20708b2023-11-28 19:05:552023-11-28 19:05:55

Judging History

This is the latest submission verdict.

  • [2023-11-28 19:05:55]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 3560kb
  • [2023-11-28 19:05:55]
  • Submitted

answer

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

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

int n, w;

int f(int x)
{
	x = 4000 - x;
	return w - x >= 0 ? w - x : w + x;
}

int main()
{
	ios::sync_with_stdio(0); 
	cin.tie(0);	
	cin >> n >> w;
	FOR(i, 0, n / 2)
		cout << f(i) << " " << n / 2 - i - 1 << "\n";
	FOR(i, n / 2, n)
		cout << f(i) << " " << i << "\n";
	return 0;
}

详细

Test #1:

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

input:

3 2500

output:

6500 0
6499 1
6498 2

result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

2 8124

output:

4124 0
4125 1

result:

ok correct

Test #3:

score: 0
Accepted
time: 0ms
memory: 3280kb

input:

3 3563

output:

7563 0
7562 1
7561 2

result:

ok correct

Test #4:

score: 0
Accepted
time: 0ms
memory: 3296kb

input:

4 6374

output:

2374 1
2375 0
2376 2
2377 3

result:

ok correct

Test #5:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

5 10000

output:

6000 1
6001 0
6002 2
6003 3
6004 4

result:

ok correct

Test #6:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

6 1444

output:

5444 2
5443 1
5442 0
5441 3
5440 4
5439 5

result:

ok correct

Test #7:

score: 0
Accepted
time: 0ms
memory: 3432kb

input:

7 342

output:

4342 2
4341 1
4340 0
4339 3
4338 4
4337 5
4336 6

result:

ok correct

Test #8:

score: 0
Accepted
time: 0ms
memory: 3360kb

input:

8 0

output:

4000 3
3999 2
3998 1
3997 0
3996 4
3995 5
3994 6
3993 7

result:

ok correct

Test #9:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

9 124

output:

4124 3
4123 2
4122 1
4121 0
4120 4
4119 5
4118 6
4117 7
4116 8

result:

ok correct

Test #10:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

10 11

output:

4011 4
4010 3
4009 2
4008 1
4007 0
4006 5
4005 6
4004 7
4003 8
4002 9

result:

ok correct

Test #11:

score: 0
Accepted
time: 0ms
memory: 3368kb

input:

11 8

output:

4008 4
4007 3
4006 2
4005 1
4004 0
4003 5
4002 6
4001 7
4000 8
3999 9
3998 10

result:

ok correct

Test #12:

score: 0
Accepted
time: 1ms
memory: 3384kb

input:

12 10000

output:

6000 5
6001 4
6002 3
6003 2
6004 1
6005 0
6006 6
6007 7
6008 8
6009 9
6010 10
6011 11

result:

ok correct

Test #13:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

13 9999

output:

5999 5
6000 4
6001 3
6002 2
6003 1
6004 0
6005 6
6006 7
6007 8
6008 9
6009 10
6010 11
6011 12

result:

ok correct

Test #14:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

14 2345

output:

6345 6
6344 5
6343 4
6342 3
6341 2
6340 1
6339 0
6338 7
6337 8
6336 9
6335 10
6334 11
6333 12
6332 13

result:

ok correct

Test #15:

score: 0
Accepted
time: 0ms
memory: 3392kb

input:

15 754

output:

4754 6
4753 5
4752 4
4751 3
4750 2
4749 1
4748 0
4747 7
4746 8
4745 9
4744 10
4743 11
4742 12
4741 13
4740 14

result:

ok correct

Test #16:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

16 8723

output:

4723 7
4724 6
4725 5
4726 4
4727 3
4728 2
4729 1
4730 0
4731 8
4732 9
4733 10
4734 11
4735 12
4736 13
4737 14
4738 15

result:

ok correct

Test #17:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

17 9001

output:

5001 7
5002 6
5003 5
5004 4
5005 3
5006 2
5007 1
5008 0
5009 8
5010 9
5011 10
5012 11
5013 12
5014 13
5015 14
5016 15
5017 16

result:

ok correct

Test #18:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

18 1245

output:

5245 8
5244 7
5243 6
5242 5
5241 4
5240 3
5239 2
5238 1
5237 0
5236 9
5235 10
5234 11
5233 12
5232 13
5231 14
5230 15
5229 16
5228 17

result:

ok correct

Test #19:

score: 0
Accepted
time: 0ms
memory: 3384kb

input:

19 4324

output:

324 8
325 7
326 6
327 5
328 4
329 3
330 2
331 1
332 0
333 9
334 10
335 11
336 12
337 13
338 14
339 15
340 16
341 17
342 18

result:

ok correct

Test #20:

score: 0
Accepted
time: 0ms
memory: 3372kb

input:

20 3463

output:

7463 9
7462 8
7461 7
7460 6
7459 5
7458 4
7457 3
7456 2
7455 1
7454 0
7453 10
7452 11
7451 12
7450 13
7449 14
7448 15
7447 16
7446 17
7445 18
7444 19

result:

ok correct

Test #21:

score: 0
Accepted
time: 0ms
memory: 3348kb

input:

21 2342

output:

6342 9
6341 8
6340 7
6339 6
6338 5
6337 4
6336 3
6335 2
6334 1
6333 0
6332 10
6331 11
6330 12
6329 13
6328 14
6327 15
6326 16
6325 17
6324 18
6323 19
6322 20

result:

ok correct

Test #22:

score: 0
Accepted
time: 0ms
memory: 3296kb

input:

22 10000

output:

6000 10
6001 9
6002 8
6003 7
6004 6
6005 5
6006 4
6007 3
6008 2
6009 1
6010 0
6011 11
6012 12
6013 13
6014 14
6015 15
6016 16
6017 17
6018 18
6019 19
6020 20
6021 21

result:

ok correct

Test #23:

score: 0
Accepted
time: 0ms
memory: 3392kb

input:

23 3424

output:

7424 10
7423 9
7422 8
7421 7
7420 6
7419 5
7418 4
7417 3
7416 2
7415 1
7414 0
7413 11
7412 12
7411 13
7410 14
7409 15
7408 16
7407 17
7406 18
7405 19
7404 20
7403 21
7402 22

result:

ok correct

Test #24:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

24 1

output:

4001 11
4000 10
3999 9
3998 8
3997 7
3996 6
3995 5
3994 4
3993 3
3992 2
3991 1
3990 0
3989 12
3988 13
3987 14
3986 15
3985 16
3984 17
3983 18
3982 19
3981 20
3980 21
3979 22
3978 23

result:

ok correct

Test #25:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

25 0

output:

4000 11
3999 10
3998 9
3997 8
3996 7
3995 6
3994 5
3993 4
3992 3
3991 2
3990 1
3989 0
3988 12
3987 13
3986 14
3985 15
3984 16
3983 17
3982 18
3981 19
3980 20
3979 21
3978 22
3977 23
3976 24

result:

ok correct

Test #26:

score: 0
Accepted
time: 1ms
memory: 3512kb

input:

99 0

output:

4000 48
3999 47
3998 46
3997 45
3996 44
3995 43
3994 42
3993 41
3992 40
3991 39
3990 38
3989 37
3988 36
3987 35
3986 34
3985 33
3984 32
3983 31
3982 30
3981 29
3980 28
3979 27
3978 26
3977 25
3976 24
3975 23
3974 22
3973 21
3972 20
3971 19
3970 18
3969 17
3968 16
3967 15
3966 14
3965 13
3964 12
3963...

result:

ok correct

Test #27:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

99 1

output:

4001 48
4000 47
3999 46
3998 45
3997 44
3996 43
3995 42
3994 41
3993 40
3992 39
3991 38
3990 37
3989 36
3988 35
3987 34
3986 33
3985 32
3984 31
3983 30
3982 29
3981 28
3980 27
3979 26
3978 25
3977 24
3976 23
3975 22
3974 21
3973 20
3972 19
3971 18
3970 17
3969 16
3968 15
3967 14
3966 13
3965 12
3964...

result:

ok correct

Test #28:

score: 0
Accepted
time: 0ms
memory: 3372kb

input:

99 6346

output:

2346 48
2347 47
2348 46
2349 45
2350 44
2351 43
2352 42
2353 41
2354 40
2355 39
2356 38
2357 37
2358 36
2359 35
2360 34
2361 33
2362 32
2363 31
2364 30
2365 29
2366 28
2367 27
2368 26
2369 25
2370 24
2371 23
2372 22
2373 21
2374 20
2375 19
2376 18
2377 17
2378 16
2379 15
2380 14
2381 13
2382 12
2383...

result:

ok correct

Test #29:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

99 9999

output:

5999 48
6000 47
6001 46
6002 45
6003 44
6004 43
6005 42
6006 41
6007 40
6008 39
6009 38
6010 37
6011 36
6012 35
6013 34
6014 33
6015 32
6016 31
6017 30
6018 29
6019 28
6020 27
6021 26
6022 25
6023 24
6024 23
6025 22
6026 21
6027 20
6028 19
6029 18
6030 17
6031 16
6032 15
6033 14
6034 13
6035 12
6036...

result:

ok correct

Test #30:

score: 0
Accepted
time: 1ms
memory: 3328kb

input:

99 10000

output:

6000 48
6001 47
6002 46
6003 45
6004 44
6005 43
6006 42
6007 41
6008 40
6009 39
6010 38
6011 37
6012 36
6013 35
6014 34
6015 33
6016 32
6017 31
6018 30
6019 29
6020 28
6021 27
6022 26
6023 25
6024 24
6025 23
6026 22
6027 21
6028 20
6029 19
6030 18
6031 17
6032 16
6033 15
6034 14
6035 13
6036 12
6037...

result:

ok correct

Test #31:

score: 0
Accepted
time: 0ms
memory: 3392kb

input:

100 0

output:

4000 49
3999 48
3998 47
3997 46
3996 45
3995 44
3994 43
3993 42
3992 41
3991 40
3990 39
3989 38
3988 37
3987 36
3986 35
3985 34
3984 33
3983 32
3982 31
3981 30
3980 29
3979 28
3978 27
3977 26
3976 25
3975 24
3974 23
3973 22
3972 21
3971 20
3970 19
3969 18
3968 17
3967 16
3966 15
3965 14
3964 13
3963...

result:

ok correct

Test #32:

score: 0
Accepted
time: 0ms
memory: 3380kb

input:

100 1

output:

4001 49
4000 48
3999 47
3998 46
3997 45
3996 44
3995 43
3994 42
3993 41
3992 40
3991 39
3990 38
3989 37
3988 36
3987 35
3986 34
3985 33
3984 32
3983 31
3982 30
3981 29
3980 28
3979 27
3978 26
3977 25
3976 24
3975 23
3974 22
3973 21
3972 20
3971 19
3970 18
3969 17
3968 16
3967 15
3966 14
3965 13
3964...

result:

ok correct

Test #33:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

100 1244

output:

5244 49
5243 48
5242 47
5241 46
5240 45
5239 44
5238 43
5237 42
5236 41
5235 40
5234 39
5233 38
5232 37
5231 36
5230 35
5229 34
5228 33
5227 32
5226 31
5225 30
5224 29
5223 28
5222 27
5221 26
5220 25
5219 24
5218 23
5217 22
5216 21
5215 20
5214 19
5213 18
5212 17
5211 16
5210 15
5209 14
5208 13
5207...

result:

ok correct

Test #34:

score: 0
Accepted
time: 0ms
memory: 3392kb

input:

100 9999

output:

5999 49
6000 48
6001 47
6002 46
6003 45
6004 44
6005 43
6006 42
6007 41
6008 40
6009 39
6010 38
6011 37
6012 36
6013 35
6014 34
6015 33
6016 32
6017 31
6018 30
6019 29
6020 28
6021 27
6022 26
6023 25
6024 24
6025 23
6026 22
6027 21
6028 20
6029 19
6030 18
6031 17
6032 16
6033 15
6034 14
6035 13
6036...

result:

ok correct

Test #35:

score: 0
Accepted
time: 0ms
memory: 3396kb

input:

100 10000

output:

6000 49
6001 48
6002 47
6003 46
6004 45
6005 44
6006 43
6007 42
6008 41
6009 40
6010 39
6011 38
6012 37
6013 36
6014 35
6015 34
6016 33
6017 32
6018 31
6019 30
6020 29
6021 28
6022 27
6023 26
6024 25
6025 24
6026 23
6027 22
6028 21
6029 20
6030 19
6031 18
6032 17
6033 16
6034 15
6035 14
6036 13
6037...

result:

ok correct

Test #36:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

999 0

output:

4000 498
3999 497
3998 496
3997 495
3996 494
3995 493
3994 492
3993 491
3992 490
3991 489
3990 488
3989 487
3988 486
3987 485
3986 484
3985 483
3984 482
3983 481
3982 480
3981 479
3980 478
3979 477
3978 476
3977 475
3976 474
3975 473
3974 472
3973 471
3972 470
3971 469
3970 468
3969 467
3968 466
396...

result:

ok correct

Test #37:

score: 0
Accepted
time: 1ms
memory: 3392kb

input:

999 1

output:

4001 498
4000 497
3999 496
3998 495
3997 494
3996 493
3995 492
3994 491
3993 490
3992 489
3991 488
3990 487
3989 486
3988 485
3987 484
3986 483
3985 482
3984 481
3983 480
3982 479
3981 478
3980 477
3979 476
3978 475
3977 474
3976 473
3975 472
3974 471
3973 470
3972 469
3971 468
3970 467
3969 466
396...

result:

ok correct

Test #38:

score: 0
Accepted
time: 1ms
memory: 3508kb

input:

999 4234

output:

234 498
235 497
236 496
237 495
238 494
239 493
240 492
241 491
242 490
243 489
244 488
245 487
246 486
247 485
248 484
249 483
250 482
251 481
252 480
253 479
254 478
255 477
256 476
257 475
258 474
259 473
260 472
261 471
262 470
263 469
264 468
265 467
266 466
267 465
268 464
269 463
270 462
271 ...

result:

ok correct

Test #39:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

999 9999

output:

5999 498
6000 497
6001 496
6002 495
6003 494
6004 493
6005 492
6006 491
6007 490
6008 489
6009 488
6010 487
6011 486
6012 485
6013 484
6014 483
6015 482
6016 481
6017 480
6018 479
6019 478
6020 477
6021 476
6022 475
6023 474
6024 473
6025 472
6026 471
6027 470
6028 469
6029 468
6030 467
6031 466
603...

result:

ok correct

Test #40:

score: 0
Accepted
time: 1ms
memory: 3300kb

input:

999 10000

output:

6000 498
6001 497
6002 496
6003 495
6004 494
6005 493
6006 492
6007 491
6008 490
6009 489
6010 488
6011 487
6012 486
6013 485
6014 484
6015 483
6016 482
6017 481
6018 480
6019 479
6020 478
6021 477
6022 476
6023 475
6024 474
6025 473
6026 472
6027 471
6028 470
6029 469
6030 468
6031 467
6032 466
603...

result:

ok correct

Test #41:

score: 0
Accepted
time: 1ms
memory: 3388kb

input:

1000 0

output:

4000 499
3999 498
3998 497
3997 496
3996 495
3995 494
3994 493
3993 492
3992 491
3991 490
3990 489
3989 488
3988 487
3987 486
3986 485
3985 484
3984 483
3983 482
3982 481
3981 480
3980 479
3979 478
3978 477
3977 476
3976 475
3975 474
3974 473
3973 472
3972 471
3971 470
3970 469
3969 468
3968 467
396...

result:

ok correct

Test #42:

score: 0
Accepted
time: 1ms
memory: 3388kb

input:

1000 1

output:

4001 499
4000 498
3999 497
3998 496
3997 495
3996 494
3995 493
3994 492
3993 491
3992 490
3991 489
3990 488
3989 487
3988 486
3987 485
3986 484
3985 483
3984 482
3983 481
3982 480
3981 479
3980 478
3979 477
3978 476
3977 475
3976 474
3975 473
3974 472
3973 471
3972 470
3971 469
3970 468
3969 467
396...

result:

ok correct

Test #43:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

1000 1321

output:

5321 499
5320 498
5319 497
5318 496
5317 495
5316 494
5315 493
5314 492
5313 491
5312 490
5311 489
5310 488
5309 487
5308 486
5307 485
5306 484
5305 483
5304 482
5303 481
5302 480
5301 479
5300 478
5299 477
5298 476
5297 475
5296 474
5295 473
5294 472
5293 471
5292 470
5291 469
5290 468
5289 467
528...

result:

ok correct

Test #44:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

1000 9999

output:

5999 499
6000 498
6001 497
6002 496
6003 495
6004 494
6005 493
6006 492
6007 491
6008 490
6009 489
6010 488
6011 487
6012 486
6013 485
6014 484
6015 483
6016 482
6017 481
6018 480
6019 479
6020 478
6021 477
6022 476
6023 475
6024 474
6025 473
6026 472
6027 471
6028 470
6029 469
6030 468
6031 467
603...

result:

ok correct

Test #45:

score: 0
Accepted
time: 0ms
memory: 3388kb

input:

1000 10000

output:

6000 499
6001 498
6002 497
6003 496
6004 495
6005 494
6006 493
6007 492
6008 491
6009 490
6010 489
6011 488
6012 487
6013 486
6014 485
6015 484
6016 483
6017 482
6018 481
6019 480
6020 479
6021 478
6022 477
6023 476
6024 475
6025 474
6026 473
6027 472
6028 471
6029 470
6030 469
6031 468
6032 467
603...

result:

ok correct