제출 #369098

#제출 시각아이디문제언어결과실행 시간메모리
369098NachoLibre친구 (IOI14_friend)C++17
0 / 100
1097 ms512 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]; for(int i = 1; i < n; ++i) { if(ptc[i] == 0 || ptc[i] == 2) { v[i].push_back(hst[i]); } if(ptc[i] == 1 || ptc[i] == 2) { for(int x : v[hst[i]]) { v[i].push_back(x); } } } for(int b = 1; b < (1 << n); ++b) { bool ms = 1; int x = 0; for(int i = 0; i < n; ++i) { if(b & (1 << i)) { x += cfd[i]; for(int x : v[i]) { if(b & (1 << x)) { ms = 0; break; } } } if(!ms) break; } if(ms) 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...