Submission #1048918

# Submission time Handle Problem Language Result Execution time Memory
1048918 2024-08-08T11:06:45 Z nisanduu Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 7412 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();
    vector<int> s(n);
    
    for(ll i=0;i<n;i++){
        for(ll j=l[i];j<=r[i];j++){
            if(v[i]>0){
                s[j] = max(s[j]+v[i],c[i]);
            }else{
                s[j] = min(s[j]-v[i],0);
            }
        }
    }
    
    return s;
}
# 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 Execution timed out 5035 ms 7412 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 600 KB Execution killed with signal 6
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 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -