답안 #1063442

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1063442 2024-08-17T18:35:30 Z deera 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 13396 KB
#include <bits/stdc++.h>
using namespace std;


vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) {
    int n = c.size(), q = v.size();

    if (n <= 2000 && q <= 2000) {
        vector<int> res(n, 0);
        for (int i = 0; i < q; i++) {
            for (int j = l[i]; j <= r[i]; j++) {
                res[j] = max(min(res[j] + v[i], c[j]), 0);
            }
        }
        return res;
    }
}

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:17:1: warning: control reaches end of non-void function [-Wreturn-type]
   17 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 476 KB Output is correct
5 Correct 2 ms 500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5042 ms 12252 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 163 ms 8020 KB Output is correct
3 Correct 131 ms 6056 KB Output is correct
4 Execution timed out 5066 ms 13396 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 326 ms 7648 KB Output is correct
4 Correct 306 ms 3924 KB Output is correct
5 Execution timed out 5020 ms 10832 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 476 KB Output is correct
5 Correct 2 ms 500 KB Output is correct
6 Execution timed out 5042 ms 12252 KB Time limit exceeded
7 Halted 0 ms 0 KB -