제출 #1171688

#제출 시각아이디문제언어결과실행 시간메모리
1171688doquang.qtvHandcrafted Gift (IOI20_gift)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define for(n) for (int i = 0; i < n; ++i) int main() { string s; int N = 5000, n, r, a[N], b[N], c[N], x[N]; cin >> n >> r; for (r) cin >> a[i] >> b[i] >> x[i]; for (n) c[i] = i; for (r) if (x[i] == 1) c[b[i]] = min(c[b[i]], a[i]); for (n - 1) c[n - i - 2] = min(c[n - i - 2], c[n - i - 1]); for (n) c[i] = c[c[i]]; for (n) s += 'R'; for (r) if (x[i]==2) if (c[b[i]] <= a[i]) { cout << 0; return 0; } for (n - 1) if (c[i + 1] != i + 1) s[i + 1] = s[i]; else if (s[i] == 'R') s[i + 1] = 'B'; cout << s; }

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

/usr/bin/ld: /tmp/ccwNXGpK.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc23S44W.o:gift.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccwNXGpK.o: in function `main':
grader.cpp:(.text.startup+0x23e): undefined reference to `construct(int, 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