Submission #769439

# Submission time Handle Problem Language Result Execution time Memory
769439 2023-06-29T14:39:58 Z YassirSalama Distributing Candies (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;
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Incorrect 69 ms 12180 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -