제출 #830885

#제출 시각아이디문제언어결과실행 시간메모리
830885Johann사탕 분배 (IOI21_candies)C++17
컴파일 에러
0 ms0 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef vector<ll> vi; #define sz(x) (int)(x).size() #define all(x) (x).begin(), (x).end() int N, Q; std::vector<int> distribute_candies(vi c, vi l, vi r, vi v) { N = sz(c); Q = sz(l); vi S(N, 0); for (int q = 0; q < Q; ++q) { S[l[q]] += v[q]; S[++r[q]] -= v[q]; } partial_sum(all(S), S.begin()); for (int i = 0; i < N; ++i) S[i] = min(c[i], S[i]); vector<int> ans; for (ll x : S) ans.push_back(x); return ans; }

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/cc5BFc6U.o: in function `main':
grader.cpp:(.text.startup+0x30e): undefined reference to `distribute_candies(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status