답안 #1010249

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1010249 2024-06-28T15:02:06 Z LCJLY 카멜레온의 사랑 (JOI20_chameleon) C++14
40 / 100
18 ms 596 KB
#include "chameleon.h"
#include <bits/stdc++.h>
//#include "grader.cpp"
using namespace std;
	
//#define int long long 
#define ld long double
#define show(x,y) cout << y << " " << #x << endl;
#define show2(x,y,i,j) cout << y << " " << #x << "  " << j << " " << #i << endl;
#define show3(x,y,i,j,p,q) cout << y << " " << #x << "  " << j << " " << #i << "  " << q << " " << #p << endl;
#define show4(x,y) for(auto it:y) cout << it << " "; cout << #x << endl;
typedef pair<int,int>pii;
typedef array<int,3>pi2;

//Query(vector<int>)
//Answer(int,int)

pii f(int a, int b){
	return {min(a,b),max(a,b)};
}

void Solve(int n){
	map<pii,int>mp;
	for(int x=1;x<=2*n;x++){
		vector<int>check;
		for(int y=1;y<=2*n;y++){
			if(x==y) continue;
			int hold=Query({x,y});
			if(hold==1) check.push_back(y);
		}
		if(check.size()==1){
			mp[f(check[0],x)]++;
		}
		else if(check.size()==3){
			int hold=Query({check[0],check[1],x});
			int hold2=Query({check[0],check[2],x});
			//int hold3=Query({check[1],check[2],x});
			if(hold==1){
				mp[f(check[0],x)]++;
				mp[f(check[1],x)]++;
			}
			else if(hold2==1){
				mp[f(check[0],x)]++;
				mp[f(check[2],x)]++;
			}
			else{
				mp[f(check[1],x)]++;
				mp[f(check[2],x)]++;
			}
		}
	}
	
	for(auto it:mp){
		//cout << it.first.first << " " << it.first.second << " " << it.second << "\n";
		if(it.second==2){
			//show2(it.first.first,it.first.first,it.first.second,it.first.second);
			Answer(it.first.first,it.first.second);
		}
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 14 ms 452 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 2 ms 344 KB Output is correct
11 Correct 1 ms 344 KB Output is correct
12 Correct 1 ms 344 KB Output is correct
13 Correct 3 ms 344 KB Output is correct
14 Correct 3 ms 344 KB Output is correct
15 Correct 2 ms 596 KB Output is correct
16 Correct 2 ms 344 KB Output is correct
17 Correct 2 ms 344 KB Output is correct
18 Correct 2 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 18 ms 444 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 14 ms 452 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -