# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1035183 | Hectorungo_18 | Political Development (BOI17_politicaldevelopment) | C++14 | 131 ms | 3924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
string abc = "abcdefghijklmnopqrstuvwxyz";
// #define int long long
void solve(){
int n, k;
cin >> n >> k;
vector<vector<bool>> b(n+3, vector<bool> (n+3, 0));
vector<int> v;
for(int i = 0; i < n; i++){
int r;
cin >> r;
for(int j = 0; j < r; j++){
int a;
cin >> a;
b[i][a]=1;
}
v.push_back(i);
}
// for(int i = 0; i < n; i++){
// for(int j = 0; j < n; j++){
// // cout << i << " " << j << " " <<b[i][j] << endl;
// }
// // cout << endl;
// }
int sz = 0;
for(int i = 0; i < v.size(); i++){
int a = v[i];
set<int> s;
s.insert(a);
for(int j = 0; j < n; j++){
if(b[a][j] == 1) s.insert(j);
else continue;
// cout << "in " << a << " " << j << endl;
}
bool im = 0;
for(auto x : s){
// cout << x << endl;
int sz = 0;
for(int j = 0; j < n; j++){
if(j == x) continue;
if(s.count(j) == 1){
if(b[x][j]) sz++;
else{
// cout << x << " " << j << endl;
im = 1;
break;
}
}
}
if(im) break;
}
// cout << i << " " << a << " " << im << " " << sz << endl;
if(!im) sz = max(sz, (int) s.size());
}
cout << sz << endl;
}
int main(){
solve();
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |