Submission #288466

# Submission time Handle Problem Language Result Execution time Memory
288466 2020-09-01T14:06:52 Z Atill83 Friend (IOI14_friend) C++14
11 / 100
1000 ms 3960 KB
#include "friend.h"
#include <bits/stdc++.h>
using namespace std;
// Find out best sample
int adj[15][15];


int findSample(int n,int confidence[],int host[],int protocol[]){


	for(int i = 1; i < n; i++){
		if(protocol[i] == 0){
			adj[host[i]][i] = 1;
			adj[i][host[i]] = 1;
		}else if(protocol[i] == 1){
			for(int j = 0; j < n; j++){
				if(j == i) continue;
				if(adj[j][host[i]]){
					adj[i][j] = adj[j][i] = 1;
				}
			}

		}else{
			for(int j = 0; j < n; j++){
				if(adj[j][host[i]] || j == host[i]){
					adj[i][j] = adj[j][i] = 1;
				}
			}
		}


	}
	long long ans = 0;
	for(int i = 0; i < (1<<n); i++){
		long long sim = 0;
		for(int j = 0; j < n; j++){
			if((1<<j) & i){
				sim += confidence[j];
				for(int k = j + 1; k < n; k++){
					if((1<<k) & i){
						if(adj[j][k]) sim = -1e18;
					}
				}
			}
		}
		ans = max(ans, sim);
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 0 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 0 ms 384 KB Output is correct
8 Correct 0 ms 384 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 0 ms 384 KB Output is correct
11 Correct 0 ms 384 KB Output is correct
12 Correct 1 ms 384 KB Output is correct
13 Correct 1 ms 384 KB Output is correct
14 Correct 1 ms 384 KB Output is correct
15 Correct 1 ms 384 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1046 ms 384 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 106 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Incorrect 25 ms 512 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 0 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Correct 1 ms 384 KB Output is correct
9 Incorrect 24 ms 416 KB Output isn't correct
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 384 KB Output is correct
8 Correct 1 ms 384 KB Output is correct
9 Correct 0 ms 384 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 0 ms 384 KB Output is correct
12 Runtime error 38 ms 3960 KB Execution killed with signal 11
13 Halted 0 ms 0 KB -