답안 #441536

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
441536 2021-07-05T10:35:08 Z azberjibiou 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 9264 KB
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
const int mxN=200100;
int N, Q;
int A[mxN];
vector <int> ans;
std::vector<int> distribute_candies(vector <int> c, vector <int> l,
                                    vector <int> r, vector <int> v) {
    N=c.size();
    ans.resize(N);
    Q=v.size();
    for(int i=0;i<Q;i++)
    {
        for(int j=l[i];j<=r[i];j++)
        {
            A[j]+=v[i];
            if(A[j]<0)  A[j]=0;
            if(A[j]>c[j])   A[j]=c[j];
        }
    }
    for(int i=0;i<N;i++)    ans[i]=A[i];
    return ans;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 7 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5061 ms 9152 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 212 ms 6040 KB Output is correct
3 Correct 224 ms 6476 KB Output is correct
4 Execution timed out 5039 ms 9212 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1719 ms 6064 KB Output is correct
4 Correct 2313 ms 5504 KB Output is correct
5 Execution timed out 5052 ms 9264 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 7 ms 332 KB Output is correct
6 Execution timed out 5061 ms 9152 KB Time limit exceeded
7 Halted 0 ms 0 KB -