Submission #1043643

# Submission time Handle Problem Language Result Execution time Memory
1043643 2024-08-04T12:55:19 Z 42kangaroo Distributing Candies (IOI21_candies) C++17
3 / 100
5000 ms 8912 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();
    std::vector<int> s(n, 0);
	for (int i = 0; i < l.size(); ++i) {
		for (int j = l[i]; j <= r[i]; ++j) {
			s[j] = max(min(s[j] + v[i], c[j]), 0);
		}
	}
    return s;
}

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:10:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for (int i = 0; i < l.size(); ++i) {
      |                  ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 5040 ms 7248 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 132 ms 5112 KB Output is correct
3 Correct 104 ms 3904 KB Output is correct
4 Execution timed out 5025 ms 7248 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 261 ms 5164 KB Output is correct
4 Correct 264 ms 3364 KB Output is correct
5 Execution timed out 5050 ms 8912 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
6 Execution timed out 5040 ms 7248 KB Time limit exceeded
7 Halted 0 ms 0 KB -