# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
236983 | 2020-06-04T07:35:42 Z | crossing0ver | 친구 (IOI14_friend) | C++17 | 7 ms | 2688 KB |
#include<bits/stdc++.h> #include "friend.h" using namespace std; const int MAXN = 1E5+5; int n,val[MAXN]; vector<int> adj[MAXN]; int case1(){ int mxval = 0; for (int i = 0; i < (1 << n); i++) { vector<int> x; for (int j = 0; j < n; j++) { if ( (1 << j) & i) x.push_back(j); } bool flag = 1; for (int j = 0; j < x.size(); j++) { for (int k = 0; k < j; k++) { for (int h : adj[x[j]]) if (h == x[k]) flag = 0; } } if (flag) { int s = 0; for (int j:x) s += val[j]; mxval = max(mxval,s); } } return mxval; } int findSample(int n1,int confidence[],int host[],int protocol[]){ n = n1; int type[] = {1,1,1}; for (int i =0; i < n; i++) val[i] = confidence[i]; for (int i = 1; i < n; i++) { int x = protocol[i]; int v = host[i]; for (int i =0; i< 3; i++) if (x != i ) type[i] = 0; if (x == 0) { adj[v].push_back(i); adj[i].push_back(v); } else { adj[i] = adj[v]; if (x == 3) { adj[i].push_back(v); adj[v].push_back(i); } } } if (n <= 10) return case1(); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Correct | 6 ms | 2688 KB | Output is correct |
6 | Correct | 6 ms | 2688 KB | Output is correct |
7 | Incorrect | 6 ms | 2688 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Incorrect | 6 ms | 2688 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 7 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Correct | 6 ms | 2688 KB | Output is correct |
6 | Correct | 6 ms | 2688 KB | Output is correct |
7 | Correct | 6 ms | 2688 KB | Output is correct |
8 | Correct | 6 ms | 2688 KB | Output is correct |
9 | Incorrect | 6 ms | 2688 KB | Output isn't correct |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 2688 KB | Output is correct |
2 | Correct | 6 ms | 2688 KB | Output is correct |
3 | Correct | 6 ms | 2688 KB | Output is correct |
4 | Correct | 6 ms | 2688 KB | Output is correct |
5 | Correct | 6 ms | 2688 KB | Output is correct |
6 | Correct | 6 ms | 2688 KB | Output is correct |
7 | Correct | 6 ms | 2688 KB | Output is correct |
8 | Correct | 6 ms | 2688 KB | Output is correct |
9 | Correct | 6 ms | 2688 KB | Output is correct |
10 | Correct | 6 ms | 2688 KB | Output is correct |
11 | Incorrect | 6 ms | 2688 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |