제출 #418389

#제출 시각아이디문제언어결과실행 시간메모리
418389jacquesamselMechanical Doll (IOI18_doll)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void answer(std::vector<int> C, std::vector<int> X, std::vector<int> Y) { for (auto y : C) { cout << y << " "; } cout << endl; } void create_circuit(int M, vector<int> A) { A.push_back(0); vector<int> moves; moves.assign(M+1, 0); int last = 0; int m = 0; for (int i = 0; i < A.size(); i++) { // cout << last << " to " << A[i] << endl; moves[last] = A[i]; m = max(m, A[i]); last = A[i]; } // cout << last << endl; answer(moves, {}, {}); }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:17:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |     for (int i = 0; i < A.size(); i++) {
      |                     ~~^~~~~~~~~~
/usr/bin/ld: /tmp/ccbBtzXg.o: in function `answer(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)':
grader.cpp:(.text+0x1f0): multiple definition of `answer(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'; /tmp/ccPIGpCe.o:doll.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status