제출 #302264

#제출 시각아이디문제언어결과실행 시간메모리
302264EJOI2019Andrew슈퍼트리 잇기 (IOI20_supertrees)C++14
컴파일 에러
0 ms0 KiB
#include "supertrees.h" #include <vector> #include<bits/stdc++.h> using namespace std; int construct(std::vector<std::vector<int>> p) { vector<vector<int>> answer; answer.assign(p.size()+1,vector<int>()); for(int i=0; i<p.size(); ++i) { for(int j=0; j<p.size(); ++j) answer[i][j]=0; } for(int i=0; i<n-1; ++i) answer[i][i+1]=1; build(answer); return 1; }

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

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:8:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |  for(int i=0; i<p.size(); ++i)
      |               ~^~~~~~~~~
supertrees.cpp:10:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |     for(int j=0; j<p.size(); ++j)
      |                  ~^~~~~~~~~
supertrees.cpp:13:20: error: 'n' was not declared in this scope
   13 |     for(int i=0; i<n-1; ++i)
      |                    ^