제출 #296311

#제출 시각아이디문제언어결과실행 시간메모리
296311arayi친구 (IOI14_friend)C++17
27 / 100
41 ms4352 KiB
#include <bits/stdc++.h> #include "friend.h" #define ad push_back using namespace std; const int N = 1010; vector <int> g[N]; bool col[20][20]; int findSample(int n,int c[],int host[],int pr[]) { bool mk, erk, erq; mk=erk=erq=0; for (int i = 1; i < n; i++) { if(pr[i] == 0) { g[host[i]].ad(i); g[i].ad(host[i]); mk = 1; } else if(pr[i] == 1) { for(auto p : g[host[i]]) g[p].ad(i), g[i].ad(p); erk = 1; } else { for(auto p : g[host[i]]) g[p].ad(i), g[i].ad(p); g[host[i]].ad(i); g[i].ad(host[i]); erq = 1; } } if(n <= 10) { for (int i = 0; i < n; i++) for(auto p : g[i]) col[i][p] = 1;//, cout << i << " " << p << endl; int pat = 0; for(int x = 0; x < (1 << n); ++x) { int sum = 0; vector <int> sm; for (int i = 0; i < n; i++) if(x & (1 << i)) sum += c[i], sm.ad(i); bool bl = 0; for(auto p : sm) for(auto p1 : sm) if(col[p][p1]) bl = true; if(!bl) pat = max(pat, sum); } return pat; } if(!mk && erk && !erq) { int pat = 0; for (int i = 0; i < n; i++) pat += c[i]; return pat; } if(!mk && !erk && erq) { int pat = 0; for (int i = 0; i < n; i++) pat = max(pat, c[i]); return pat; } }

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

friend.cpp: In function 'int findSample(int, int*, int*, int*)':
friend.cpp:66:1: warning: control reaches end of non-void function [-Wreturn-type]
   66 | }
      | ^
#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...