제출 #1133712

#제출 시각아이디문제언어결과실행 시간메모리
1133712alterio사탕 분배 (IOI21_candies)C++20
0 / 100
62 ms8004 KiB
#include <bits/stdc++.h> #include "candies.h" using namespace std; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = c.size(), q = l.size(); vector<int> s(n); int prf[n + 1]; memset(prf, 0, sizeof(prf)); for (int i = 0; i < q; i++) prf[l[i]] += v[i], prf[r[i] + 1] -= v[i]; int sum = 0; for (int i = 0; i < n; i++) { sum += prf[i]; s[i] = min(sum, c[i]); } return s; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...