QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#523856#1140. Distributing Candiesgreen_gold_dog#8 57ms11912kbC++20539b2024-08-18 19:51:372024-08-18 19:51:37

Judging History

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

  • [2024-08-18 19:51:37]
  • 评测
  • 测评结果:8
  • 用时:57ms
  • 内存:11912kb
  • [2024-08-18 19:51:37]
  • 提交

answer

#include "candies.h"
#include <bits/stdc++.h>

using namespace std;

typedef int ll;

vector<ll> distribute_candies(vector<ll> c, vector<ll> l, vector<ll> r, vector<ll> v) {
	ll n = c.size(), q = v.size();
	vector<long long> ans(n + 1, 0);
	for (ll i = 0; i < q; i++) {
		ans[l[i]] += v[i];
		ans[r[i] + 1] -= v[i];
	}
	for (ll i = 1; i < n; i++) {
		ans[i] = ans[i] + ans[i - 1];
	}
	for (ll i = 0; i < n; i++) {
		ans[i] = min(ans[i], (long long)c[i]);
	}
	vector<ll> a(n);
	for (ll i = 0; i < n; i++) {
		a[i] = ans[i];
	}
	return a;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 3
Accepted
time: 0ms
memory: 3820kb

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
8
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
8
0 7 1
0 7 1
0 7 300000000
0 7 994967293
0 7 1
0 7 1000000000
0 7 1000000000
0 7 1000000000

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000

result:

ok 3 lines

Test #2:

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

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
10
283 43634 101056 10340 6009 5133 30 2 3677888 210
10
1 8 26416
2 7 -51219
2 4 17793
3 7 75426
3 7 22307
1 1 60258
3 7 -29824
0 8 24839
2 8 -60304
0 1 -26411

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
-1572 43634 -42475 10340 6009 5133 30 2 -9049 0

result:

wrong answer 3rd lines differ - expected: '0 17223 0 0 0 0 0 0 0 0', found: '-1572 43634 -42475 10340 6009 5133 30 2 -9049 0'

Subtask #2:

score: 8
Accepted

Test #6:

score: 8
Accepted
time: 57ms
memory: 11904kb

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
200000
11408901 370732653 37843 28 53693 15782410 103 297546 1112427 170319071 26 1 6172 11614171 431 884673599 1 3 50085 154 57 28200 145886 898969 74758 72 845768 6 69787 11 31012465 55362 253 2363145 47186217 1103 19622 594 7867 1 4299 28130 48 4689582 12 ...

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
87153 87153 37843 28 53693 406667 103 297546 766665 971468 26 1 6172 1257294 431 1536484 1 3 50085 154 57 28200 145886 898969 74758 72 845768 6 69787 11 3043755 55362 253 2363145 3459533 1103 19622 594 7867 1 4299 28130 48 4317336 12 431 123 4531465 4806 3...

result:

ok 3 lines

Test #7:

score: 8
Accepted
time: 56ms
memory: 11828kb

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
200000
36 596 2 302 1 22 7381829 295 411 221 267845 2822 635 22 45033 2 3 24 15 1 585 2832326 80 499271 110 192 6185 1752 302907 52967 3 3423576 5373 63 2196 35 113 1209 303 12 89 4572 4 13274 5867 10158 33467 3128 776575 59189 23 11698 637 3 330 1 1 18 3534 ...

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
36 295 2 302 1 22 529 295 411 221 771 931 635 22 997 2 3 24 15 1 585 1803 80 1928 110 192 2072 1752 2113 2222 3 2336 2351 63 2196 35 113 1209 303 12 89 3734 4 3736 3736 3931 4234 3128 4408 4562 23 5099 637 3 330 1 1 18 3534 2589 6286 6406 1042 6596 1 6685 ...

result:

ok 3 lines

Test #8:

score: 8
Accepted
time: 52ms
memory: 11912kb

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
200000
423807 103641 5 2833 134 4447875 716134 10 300 7393 6 801 5256389 2604 521049 1670294 35 12249 12 29904 691656 393760 22 409 2 956844 8846653 19 1926 769 36 3577 55 524387 154184 165995 753 3709 29260 41947 89 27779 5115776 1 63 1 374 72 1788 41555 274...

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
11 25 5 52 52 53 53 10 66 69 6 86 105 114 123 145 35 155 12 177 177 178 22 229 2 229 239 19 264 280 36 295 55 298 313 328 337 356 375 385 89 388 425 1 63 1 374 72 515 525 525 531 3 5 7 564 573 584 61 631 644 648 8 14 664 316 558 676 686 705 705 736 79 747 ...

result:

ok 3 lines

Subtask #3:

score: 0
Wrong Answer

Test #9:

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

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000...

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -251 -2...

result:

wrong answer 3rd lines differ - expected: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'

Subtask #4:

score: 0
Wrong Answer

Test #16:

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

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
10
11 440 51 41 11 1 3 108 148 14
10
0 9 60
0 9 -9
0 9 -30
0 9 41
0 9 82
0 9 69
0 9 -79
0 9 -39
0 9 72
0 9 41

output:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
11 208 51 41 11 1 3 108 148 14

result:

wrong answer 3rd lines differ - expected: '11 208 51 41 11 1 3 108 143 14', found: '11 208 51 41 11 1 3 108 148 14'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%