제출 #603516

#제출 시각아이디문제언어결과실행 시간메모리
603516Siffer열쇠 (IOI21_keys)C++17
20 / 100
3062 ms13016 KiB
#include<bits/stdc++.h> using namespace std; vector<int> find_reachable(vector<int> r, vector<int> u, vector<int> v, vector<int> c) { int n = r.size(); vector<int> ans(n, 0); vector<bool> vi(n, 0); vector<bool> keys(n, 0); int m = n; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) vi[j] = 0, keys[j] = 0; vi[i] = 1; keys[r[i]] = 1; for(int k = 0; k < n; k++) { for(int j = 0; j < u.size(); j++) { if(vi[u[j]] && keys[c[j]]) vi[v[j]] = 1, keys[r[v[j]]] = 1; if(vi[v[j]] && keys[c[j]]) vi[u[j]] = 1, keys[r[u[j]]] = 1; } } int c = 0; for(int j = 0; j < n; j++) if(vi[j]) c++; m = min(c, m); ans[i] = c; } for(int i = 0; i < n; i++) ans[i] = ans[i] == m ? 1 : 0; return ans; }

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

keys.cpp: In function 'std::vector<int> find_reachable(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
keys.cpp:15:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   15 |             for(int j = 0; j < u.size(); 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...