# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
807724 | Mouad_ouj | Distributing Candies (IOI21_candies) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "candies"
#include<bits/stdc++.h>
using namespace std;
vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v)
{
vector<int> a;
a.resize(c.size());
for(int y=0;y<l.size();y++)
{
for(int x=l[y];x<r[y];x++)
{
if(v[y]>0)
a[x]=min(a[x]+v[y],c[x]);
else
a[x]=max(a[x]+v[y],0);
}
}
return a;
}