제출 #447424

#제출 시각아이디문제언어결과실행 시간메모리
447424Nodir_Bobiev슈퍼트리 잇기 (IOI20_supertrees)C++17
컴파일 에러
0 ms0 KiB
#include "supertrees.h" #include <bits/stdc++.h> using namespace std ; int construct(std::vector<std::vector<int>> p) { vector <vector <long>> ans; for(int i = 0; i < n; i ++){ vector <long> row; row.resize(n); ans.push_back(row); } for(int i = 0; i < n; i ++){ if( us[i] ) continue; for(int j = 0; j < n; j ++){ if( p[i][j] ){ if( us[j] ) return 0; us[j] = 1; ans[i][j] = ans[j][1] = 1; } } } build(ans); return 1; }

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

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:7:26: error: 'n' was not declared in this scope
    7 |       for(int i = 0; i < n; i ++){
      |                          ^
supertrees.cpp:12:26: error: 'n' was not declared in this scope
   12 |       for(int i = 0; i < n; i ++){
      |                          ^
supertrees.cpp:13:17: error: 'us' was not declared in this scope
   13 |             if( us[i] ) continue;
      |                 ^~
supertrees.cpp:16:25: error: 'us' was not declared in this scope
   16 |                     if( us[j] ) return 0;
      |                         ^~
supertrees.cpp:17:21: error: 'us' was not declared in this scope
   17 |                     us[j] = 1;
      |                     ^~
supertrees.cpp:22:13: error: could not convert 'ans' from 'vector<vector<long int>>' to 'vector<vector<int>>'
   22 |       build(ans);
      |             ^~~
      |             |
      |             vector<vector<long int>>