제출 #412851

#제출 시각아이디문제언어결과실행 시간메모리
412851Ahmadsm2005자동 인형 (IOI18_doll)C++14
컴파일 에러
0 ms0 KiB
//#include "doll.h" #include "grader.cpp" #include<bits/stdc++.h> using namespace std; void create_circuit(int M,vector<int>A){ int N = A.size(); vector<int> C(M + 1); C[0] = -1; for (int i = 1; i <= M; ++i) { C[i] = -1; } vector<int>X,Y; string s; while(N){ s+=('0'+N%2); N/=2; } reverse(s.begin(),s.end()); for(int i=0;i<s.size();i++){ if(s[i]=='1') X.push_back(1); else X.push_back(-1); if(i+1!=s.size()) Y.push_back((-i)-2); } Y.push_back(0); /*for(int i=0;i<X.size();i++) cout<<X[i]<<' '; cout<<endl; for(int i=0;i<Y.size();i++) cout<<Y[i]<<' ';*/ answer(C, X, Y); }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:19:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 | for(int i=0;i<s.size();i++){
      |             ~^~~~~~~~~
doll.cpp:24:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 | if(i+1!=s.size())
      |    ~~~^~~~~~~~~~
/usr/bin/ld: /tmp/ccNLdC0r.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/ccqmAPct.o:doll.cpp:(.text+0x1f0): first defined here
/usr/bin/ld: /tmp/ccNLdC0r.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccqmAPct.o:doll.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status