# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
941792 | Numberz | 사탕 분배 (IOI21_candies) | C++17 | 5077 ms | 13268 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) {
int q = l.size();
vector<int> ans(c.size(), 0);
for (int k = 0; k < c.size(); k++) {
//we go through each box and now perform the check on each
for (int day = 0; day < q; day++) {
//if l r constraints
if (k >= l[day] && k <= r[day]) {
if (v[day] > 0) {
ans[k] = min(c[k], ans[k] + v[day]);
}
else {
ans[k] = max(0, ans[k] + v[day]);
}
}
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |