Submission #1048923

# Submission time Handle Problem Language Result Execution time Memory
1048923 2024-08-08T11:09:33 Z nisanduu Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 7420 KB
#include "candies.h"

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> distribute_candies(vector<int> c, vector<int> l,
                                    vector<int> r, vector<int> v) {
    int n = c.size();
    int q = l.size();
    vector<int> s(n);
    
    for(ll i=0;i<q;i++){
        for(ll j=l[i];j<=r[i];j++){
            if(v[i]>0){
                s[j] = min(s[j]+v[i],c[j]);
            }else{
                s[j] = max(s[j]-v[i],0);
            }
        }
    }
    
    return s;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5060 ms 7420 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB Output isn't correct
3 Halted 0 ms 0 KB -