제출 #433751

#제출 시각아이디문제언어결과실행 시간메모리
433751SAAD슈퍼트리 잇기 (IOI20_supertrees)C++17
0 / 100
1 ms332 KiB
#include <iostream> #include <math.h> #include <algorithm> #include <vector> #include <string.h> #include "supertrees.h" using namespace std; int tree[10002], n; vector <int> te[1006]; int construct(vector<vector<int>> p) { n = (int)p.size(); vector <int> s(n); vector<vector<int>> a; a = p; for (auto& i : a[0]) i = 0; memset(tree, -1, sizeof(tree)); for (int i = 0; i < n; i++) { a[i] = a[0]; if (tree[i] != -1) { if (p[i] != p[tree[i]]) return 0; continue; } for (int j = 0; j < n; j++) { if (p[i][j]) { tree[j] = i; te[i].push_back(j); } } } for (int i = 0; i < 1002; i++) { if (tree[i] == i) { for (int j = 0; j < te[i].size()-1;j++) { a[te[i][j]][te[i][j + 1]] = 1; a[te[i][j + 1]][te[i][j]] = 1; } a[te[i][0]][te[i][te[i].size()-1]] = 1; a[te[i][te[i].size() - 1]][te[i][0]] = 1; } } build(a); return 1; }

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

supertrees.cpp: In function 'int construct(std::vector<std::vector<int> >)':
supertrees.cpp:32:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   32 |             for (int j = 0; j < te[i].size()-1;j++) {
      |                             ~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...