답안 #681370

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
681370 2023-01-12T21:16:56 Z Gabriel 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 13288 KB
#include "candies.h"
#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();
    vector<int> s(n, 0);
    int aa = 0;
    while(aa != v.size()){
        int bb = l[aa];
        while(bb <= r[aa]){
            if(v[aa] > 0) s[bb] = min(c[bb], s[bb] + v[aa]);
            else s[bb] = max(0, s[bb] + v[aa]);
            bb++;
        }
        aa++;
    }
    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:8:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     while(aa != v.size()){
      |           ~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 312 KB Output is correct
5 Correct 3 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5015 ms 12124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 177 ms 7980 KB Output is correct
3 Correct 154 ms 5916 KB Output is correct
4 Execution timed out 5030 ms 13288 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 424 ms 7660 KB Output is correct
4 Correct 385 ms 4012 KB Output is correct
5 Execution timed out 5057 ms 10788 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 312 KB Output is correct
5 Correct 3 ms 340 KB Output is correct
6 Execution timed out 5015 ms 12124 KB Time limit exceeded
7 Halted 0 ms 0 KB -