제출 #808855

#제출 시각아이디문제언어결과실행 시간메모리
808855OrazB친구 (IOI14_friend)C++14
0 / 100
1085 ms8676 KiB
#include <bits/stdc++.h> #include "friend.h" using namespace std; #define all(x) (x).begin(), (x).end() #define ll long long int #define pii pair <int, int> #define pb push_back #define ff first #define ss second const int N = 1e5+5; int c[N]; ll mx = 0; vector<int> E[N]; void bit(int x, int n, int A[]){ if (x == n){ ll sum = 0; for (int i = 0; i < n; i++){ if (c[i]){ for (auto j : E[i]) if (c[j]) return; sum += A[i]; } } mx = max(mx, sum); return; } for (int i = 0; i < 2; i++){ c[x] = i; bit(x+1, n, A); } } int findSample(int n, int A[], int u[], int v[]){ for (int i = 1; i < n; i++){ if (v[i] == 0 or v[i] == 2){ E[i].pb(u[i]); E[u[i]].pb(i); } if (v[i] == 1 or v[i] == 2){ for (auto j : E[u[i]]){ E[i].pb(j); E[j].pb(i); } } } bit(0, n, A); return mx; } // int main () // { // ios::sync_with_stdio(false); // cin.tie(0); // cin >> t; // while (t--){ // } // }
#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...