제출 #384904

#제출 시각아이디문제언어결과실행 시간메모리
384904Ahmadsm2005슈퍼트리 잇기 (IOI20_supertrees)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.cpp" //#include "supertrees.h" using namespace std; int N,edges[1001][1001],GRP[1001],Z; vector<vector<int>>ALL; void CONNECT(vector<int>X){ for(int i=1;i<X.size();i++) edges[X[i]][X[i-1]]=1,edges[X[i-1]][X[i]]=1; } int construct(std::vector<std::vector<int>>p){ N=p.size(); for(int i=0;i<1001;i++) GRP[i]=-1; for(int i=0;i<N;i++){ if(!p[i][i]) exit(-1); vector<int>TEMP; if(GRP[i]+1) continue; TEMP.push_back(i); GRP[i]=Z; for(int l=0;l<N;l++){ if(p[i][l]&&i!=l){ if(GRP[l]+1) return 0; TEMP.push_back(l),GRP[l]=Z; } } for(int l=0;l<TEMP.size();l++){ int CNT=0; for(int x=0;x<TEMP.size();x++){ if(l!=x&&(!p[TEMP[l]][TEMP[x]])) return 0; } for(int x=0;x<N;x++) if(p[TEMP[l]][x]) CNT++; if(CNT!=TEMP.size()) return 0; } ALL.push_back(TEMP); Z++; } for(int i=0;i<ALL.size();i++) CONNECT(ALL[i]); vector<vector<int>>ANS; for(int i=0;i<N;i++){ vector<int>FF; for(int l=0;l<N;l++) FF.push_back(edges[i][l]); ANS.push_back(FF); } build(ANS); return 1; }

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

supertrees.cpp: In function 'void CONNECT(std::vector<int>)':
supertrees.cpp:8:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 | for(int i=1;i<X.size();i++)
      |             ~^~~~~~~~~
supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:30:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 | for(int l=0;l<TEMP.size();l++){
      |             ~^~~~~~~~~~~~
supertrees.cpp:32:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 | for(int x=0;x<TEMP.size();x++){
      |             ~^~~~~~~~~~~~
supertrees.cpp:39:7: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 | if(CNT!=TEMP.size())
      |    ~~~^~~~~~~~~~~~~
supertrees.cpp:45:14: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 | for(int i=0;i<ALL.size();i++)
      |             ~^~~~~~~~~~~
/tmp/cchOC4aE.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/cc8rHcyw.o:supertrees.cpp:(.text.startup+0x0): first defined here
/tmp/cchOC4aE.o: In function `build(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)':
grader.cpp:(.text+0x1d0): multiple definition of `build(std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
/tmp/cc8rHcyw.o:supertrees.cpp:(.text+0x230): first defined here
collect2: error: ld returned 1 exit status