제출 #369120

#제출 시각아이디문제언어결과실행 시간메모리
369120NachoLibre친구 (IOI14_friend)C++17
11 / 100
1071 ms65540 KiB
#include <bits/stdc++.h> using namespace std; #define sz(a) ((int)(a).size()) typedef vector<int> vint; typedef vector<vint> vvint; #ifndef wambule #include "friend.h" #else #endif int findSample(int n, int cfd[], int hst[], int ptc[]) { int dr = 0; vector<int> v[n]; vector<pair<int, int>> u; for(int i = 1; i < n; ++i) { if(ptc[i]) { for(int x : v[hst[i]]) { v[i].push_back(x); v[x].push_back(i); u.push_back({i, x}); } } if(ptc[i] ^ 1) { v[i].push_back(hst[i]); v[hst[i]].push_back(i); u.push_back({i, hst[i]}); } } for(int b = 1; b < (1 << n); ++b) { bool ms = 1; int x = 0; for(int i = 0; i < sz(u); ++i) { if((b & (1 << u[i].first)) && (b & (1 << u[i].second))) { ms = 0; break; } } if(!ms) continue; for(int i = 0; i < n; ++i) { if(b & (1 << i)) { x += cfd[i]; } } dr = max(dr, x); } return dr; } #ifdef wambule int main() { ios::sync_with_stdio(0); cin.tie(0); return 0; } #endif
#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...