Submission #164447

# Submission time Handle Problem Language Result Execution time Memory
164447 2019-11-20T16:05:22 Z Lawliet ICC (CEOI16_icc) C++14
7 / 100
474 ms 896 KB
#include <bits/stdc++.h>
#include "icc.h"
 
using namespace std;
typedef pair<int,int> pii;
 
int N;
 
map< pii , bool > hasEdge;
 
void run(int n)
{
	N = n;
 
	for(int k = 1 ; k < N ; k++)
	{
		bool find = false;
 
		int ansA = 0;
		int ansB = 0;
 
		for(int i = 1 ; i <= n && !find ; i++)
		{
			for(int j = i + 1 ; j <= n && !find ; j++)
			{
				if( hasEdge[ { i , j } ] ) continue;
 
				int A[3] = { i , 0 , 0 };
				int B[1] = { j };
 
				int ans = query( 1 , 1 , A , B );
 
				if( ans == 1 )
				{
					find = true;
 
					ansA = i;
					ansB = j;
				}
			}
		}
 
		hasEdge[ { ansA , ansB } ] = true;
 
		setRoad( ansA , ansB );
	}
}
# Verdict Execution time Memory Grader output
1 Correct 62 ms 504 KB Ok! 1015 queries used.
2 Correct 85 ms 504 KB Ok! 1010 queries used.
# Verdict Execution time Memory Grader output
1 Incorrect 360 ms 632 KB Number of queries more than 5000 out of 2500
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 474 ms 896 KB Number of queries more than 4500 out of 2250
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 436 ms 856 KB Number of queries more than 4000 out of 2000
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 395 ms 760 KB Number of queries more than 3550 out of 1775
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 389 ms 856 KB Number of queries more than 3250 out of 1625
2 Halted 0 ms 0 KB -