Submission #164424

# Submission time Handle Problem Language Result Execution time Memory
164424 2019-11-20T13:57:37 Z Lawliet ICC (CEOI16_icc) C++14
0 / 100
16 ms 632 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[1] = { i };
				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 Incorrect 3 ms 504 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 504 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 632 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 560 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 504 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 16 ms 504 KB Wrong road!
2 Halted 0 ms 0 KB -