답안 #769439

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
769439 2023-06-29T14:39:58 Z YassirSalama 사탕 분배 (IOI21_candies) C++17
3 / 100
69 ms 12180 KB
#include "candies.h"

#include <vector>

std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
                                    std::vector<int> r, std::vector<int> v) {
    int n = c.size();
    int q=v.size();
    std::vector<int> s(n);
    if(n<=2000&&q<=2000){
        for(int j=0;j<q;j++){
            int ll=l[j],rr=r[j],cc=v[j];
            for(int i=ll;i<=rr;i++){
                s[i]=std::max(0,std::min(c[i],s[i]+cc));
            }
        }
    }else{

    }
    return s;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 69 ms 12180 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 296 KB Output is correct
2 Incorrect 39 ms 8008 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 37 ms 7576 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
6 Incorrect 69 ms 12180 KB Output isn't correct
7 Halted 0 ms 0 KB -