답안 #826549

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
826549 2023-08-15T16:43:29 Z Seb 사탕 분배 (IOI21_candies) C++17
0 / 100
76 ms 18084 KB
#include "candies.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
                                    std::vector<int> r, std::vector<int> v) {
    ll n = c.size();
    vector <int> ans;
    for (int j=0;j<l.size();j++) for (int i=l[j];i<=r[j];i++) ans[i] = max(min(c[i],ans[i]+v[j]),0);
    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:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int j=0;j<l.size();j++) for (int i=l[j];i<=r[j];i++) ans[i] = max(min(c[i],ans[i]+v[j]),0);
      |                  ~^~~~~~~~~
candies.cpp:9:8: warning: unused variable 'n' [-Wunused-variable]
    9 |     ll n = c.size();
      |        ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 76 ms 18084 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -