Submission #769443

# Submission time Handle Problem Language Result Execution time Memory
769443 2023-06-29T14:46:31 Z YassirSalama Distributing Candies (IOI21_candies) C++17
3 / 100
79 ms 14120 KB
#include "candies.h"
#include<bits/stdc++.h>
#include <vector>
using namespace std;
#define ll long long
vector<int> distribute_candies(vector<int> c, vector<int> l,
                                    vector<int> r, vector<int> v) {
    int n = c.size();
    int q=v.size();
    vector<ll> s(n);
    if(n<=2000&&q<=2000){
        for(int j=0;j<q;j++){
            int lrr=l[j],rr=r[j],cc=v[j];
            for(int i=lrr;i<=rr;i++){
                s[i]=max(0LL,min((long long)c[i],s[i]+cc));
            }
        }
    }else{

    }
    vector<int> ans;
    for(auto x:s) ans.push_back(x);
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 312 KB Output is correct
4 Correct 1 ms 316 KB Output is correct
5 Correct 3 ms 416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 79 ms 14120 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 43 ms 8008 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Incorrect 57 ms 7628 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 312 KB Output is correct
4 Correct 1 ms 316 KB Output is correct
5 Correct 3 ms 416 KB Output is correct
6 Incorrect 79 ms 14120 KB Output isn't correct
7 Halted 0 ms 0 KB -