Submission #436248

# Submission time Handle Problem Language Result Execution time Memory
436248 2021-06-24T11:01:19 Z Apiram Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 7340 KB
#include "candies.h"
#include<bits/stdc++.h>
using namespace std;
std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
             
    				 
    				                       std::vector<int> r, std::vector<int> v) {

    int n = c.size();
    vector<int>ans(n,0);
    for (int i = 0;i<l.size();++i){
    	for (int j =l[i];j<=r[i];++j){
    		ans[j]=max(0,min(ans[j]+v[i],c[j]));
    	}
    }
    return ans;
}

Compilation message

candies.cpp: In function 'std::vector<int> distribute_candies(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
candies.cpp:11:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int i = 0;i<l.size();++i){
      |                    ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 312 KB Output is correct
5 Correct 4 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5030 ms 7272 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 292 ms 4960 KB Output is correct
3 Correct 312 ms 3864 KB Output is correct
4 Execution timed out 5041 ms 7340 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 682 ms 5020 KB Output is correct
4 Correct 598 ms 2800 KB Output is correct
5 Execution timed out 5005 ms 7236 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 2 ms 312 KB Output is correct
5 Correct 4 ms 332 KB Output is correct
6 Execution timed out 5030 ms 7272 KB Time limit exceeded
7 Halted 0 ms 0 KB -