QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#523854#1140. Distributing Candiesgreen_gold_dog#0 40ms10268kbC++20556b2024-08-18 19:49:022024-08-18 19:49:02

Judging History

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

  • [2024-08-18 19:49:02]
  • 评测
  • 测评结果:0
  • 用时:40ms
  • 内存:10268kb
  • [2024-08-18 19:49:02]
  • 提交

answer

#pragma GCC optimize("Ofast")
#include "candies.h"
#include <bits/stdc++.h>
#pragma GCC target("avx,avx2,sse,sse2,sse3,ssse3,sse4,abm,popcnt,mmx")

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<ll> 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], c[i]);
	}
	return ans;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

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

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
WA
Returned array is of the wrong size (len=9).

result:

wrong answer 2nd lines differ - expected: 'OK', found: 'WA'

Subtask #2:

score: 0
Wrong Answer

Test #6:

score: 0
Wrong Answer
time: 40ms
memory: 10268kb

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
WA
Returned array is of the wrong size (len=200001).

result:

wrong answer 2nd lines differ - expected: 'OK', found: 'WA'

Subtask #3:

score: 0
Wrong Answer

Test #9:

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

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
WA
Returned array is of the wrong size (len=1001).

result:

wrong answer 2nd lines differ - expected: 'OK', found: 'WA'

Subtask #4:

score: 0
Wrong Answer

Test #16:

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

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
WA
Returned array is of the wrong size (len=11).

result:

wrong answer 2nd lines differ - expected: 'OK', found: 'WA'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%