Submission #788513

# Submission time Handle Problem Language Result Execution time Memory
788513 2023-07-20T10:05:49 Z alexander707070 Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 13272 KB
#include<bits/stdc++.h>
#define MAXN 1000007
using namespace std;
 
int n,q;
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++){
        for(int f=l[i];f<=r[i];f++){
            curr[f]+=v[i];
            if(curr[f]<0)curr[f]=0;
            if(curr[f]>c[f])curr[f]=c[f];
        }
    }

    return curr;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 3 ms 412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5020 ms 12116 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 211 ms 8012 KB Output is correct
3 Correct 215 ms 6708 KB Output is correct
4 Execution timed out 5051 ms 13272 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 547 ms 7648 KB Output is correct
4 Correct 553 ms 4772 KB Output is correct
5 Execution timed out 5071 ms 10920 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 3 ms 412 KB Output is correct
6 Execution timed out 5020 ms 12116 KB Time limit exceeded
7 Halted 0 ms 0 KB -