제출 #447425

#제출 시각아이디문제언어결과실행 시간메모리
447425Nodir_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) { int n = p.size(); 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:14:17: error: 'us' was not declared in this scope
   14 |             if( us[i] ) continue;
      |                 ^~
supertrees.cpp:17:25: error: 'us' was not declared in this scope
   17 |                     if( us[j] ) return 0;
      |                         ^~
supertrees.cpp:18:21: error: 'us' was not declared in this scope
   18 |                     us[j] = 1;
      |                     ^~
supertrees.cpp:23:13: error: could not convert 'ans' from 'vector<vector<long int>>' to 'vector<vector<int>>'
   23 |       build(ans);
      |             ^~~
      |             |
      |             vector<vector<long int>>