# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
796703 | Minindu206 | 사탕 분배 (IOI21_candies) | C++17 | 86 ms | 12120 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 n = c.size(), q = l.size();
vector<int> candies(n, 0);
if(n <= 2000 & q <= 2000)
{
for(int i=0;i<q;i++)
{
int ll = l[i], rr = r[i];
while(ll >= rr)
{
candies[ll] += v[i];
if(candies[ll] > c[ll])
candies[ll] = c[ll];
if(candies[ll] < 0)
candies[ll] = 0;
ll++;
}
}
return candies;
}
else
{
int ans = 0;
for(int val:v)
ans += val;
for(int i=0;i<n;i++)
candies[i] = min(ans, c[i]);
return candies;
}
}
컴파일 시 표준 에러 (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... |