답안 #111983

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
111983 2019-05-17T03:31:48 Z mechfrog88 Memory 2 (JOI16_memory2) C++14
10 / 100
4 ms 432 KB
#include "Memory2_lib.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

void Solve(int T, int N){
	vector <vector<ll>> num(N);
	vector <vector<ll>> d(N*2,vector<ll>(N*2));
	vector <bool> visited(N*2,false);
	for (int x=0;x<N*2;x++){
		for (int next=0;next<N*2;next++){
			if (x == next) continue;
			d[x][next] = Flip(x,next);
		}
	}
	for (int i=N-1;i>-1;i--){
		vector <ll> arr;
		bool ok = true;
		for (int z=0;z<N*2 && ok;z++){
			if (visited[z]) continue;
			for (int x=0;x<N*2 && ok;x++){
				if (visited[x]) continue;
				if (z == x) continue;
				if (d[z][x] == i){
					arr.push_back(z);
					arr.push_back(x);
					visited[z] = true;
					visited[x] = true;
					ok = false;
				} 
			}
		}
		Answer(arr[0],arr[1],i);
	}
	
	return;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 4 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 3 ms 432 KB Output is correct
8 Correct 3 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 384 KB Wrong Answer[2]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 384 KB Wrong Answer[2]
2 Halted 0 ms 0 KB -