이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "trilib.h"
#include <bits/stdc++.h>
using namespace std ;
const int MAX = 500 + 10 ;
int N ;
int cntq = 0 ;
unordered_map<int , int>mp ;
int Hash(int x , int y , int z)
{
	return (1ll * x * (N+1) * (N+1) + y * (N+1) + z) ;
}
int query(int x , int y , int z)
{
	if(mp[Hash(x , y , z)])
		return (mp[Hash(x , y , z)] - 2) * -1 ;
	++cntq ;
	// if(cntq > 1e6)
	// 	while(1) ;
	int ans = is_clockwise(x , y , z) ;
	mp[Hash(x , y , z)] = mp[Hash(y , z , x)] = mp[Hash(z , x , y)] = 2 - ans ;
	mp[Hash(x , z , y)] = mp[Hash(y , x , z)] = mp[Hash(z , y , x)] = 2 - (!ans) ;
	return ans ;
}
int main()
{
	srand(time(NULL)) ;
	mt19937 rng(rand()) ;
	N = get_n() ;
	int ans = 0 ;
	vector<int>v ;
	for(int i = 1 ; i <= N ; ++i)
	{
		bool flag = false ;
		for(int j = 1 ; j <= N && (!flag) ; ++j)
		{
			v.clear() ;
			for(int k = 1 ; k <= N ; ++k)
			{
				if(i == j || i == k || j == k)
					continue ;
				v.push_back(k) ;
			}
			shuffle(v.begin() , v.end() , rng) ;
			flag = (i != j) ;
			for(auto &k : v)
			{
				if(!flag)
					break ;
				flag &= query(i , j , k) ;
			}
		}
		ans += flag ;
	}
	give_answer(ans) ;
	return 0 ;
}
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |