Submission #490534

# Submission time Handle Problem Language Result Execution time Memory
490534 2021-11-27T20:23:32 Z nickmet2004 Distributing Candies (IOI21_candies) C++17
0 / 100
103 ms 12868 KB
#include<bits/stdc++.h>
#include "candies.h"

#define ve vector<int>
using namespace std;
ve ans;
ve distribute_candies(ve c, ve l, ve r, ve v){
    int n =c.size() , q = v.size();
    ans.resize(n , 0);
    for(int i = 0; i < q; ++i){
        ans[l[i]] += v[i];
        ans[r[i] + 1] -= v[i];
    }
    for(int i = 1; i < n; ++i) ans[i] += ans[i - 1];
    for(int i = 0;i < n; ++i) ans[i] = min(ans[i] , c[i]);
    return ans;
}

# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 103 ms 12868 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 300 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -