Submission #788515

# Submission time Handle Problem Language Result Execution time Memory
788515 2023-07-20T10:06:53 Z alexander707070 Distributing Candies (IOI21_candies) C++17
0 / 100
80 ms 8812 KB
#include<bits/stdc++.h>
#define MAXN 1000007
using namespace std;
 
int n,q,s,sum[MAXN];
vector<int> curr;

vector<int> distribute_candies(vector<int> c,vector<int> l,vector<int> r,vector<int> v){
    n=int(c.size()); q=int(l.size());
    curr.resize(n);

    for(int i=0;i<q;i++){
        sum[l[i]]+=v[i];
        sum[r[i]+1]-=v[i];
    }

    for(int i=0;i<n;i++){
        s+=sum[i];
        curr[i]=min(s,c[i]);
    }

    return curr;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 80 ms 8812 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -