Submission #1010248

#TimeUsernameProblemLanguageResultExecution timeMemory
1010248LCJLYChameleon's Love (JOI20_chameleon)C++14
Compilation error
0 ms0 KiB
#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);
		}
	}
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccOK8MEu.o: in function `Answer(int, int)':
grader.cpp:(.text+0x40): multiple definition of `Answer(int, int)'; /tmp/ccZHZ2at.o:chameleon.cpp:(.text+0x210): first defined here
/usr/bin/ld: /tmp/ccOK8MEu.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccZHZ2at.o:chameleon.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccOK8MEu.o: in function `Query(std::vector<int, std::allocator<int> > const&)':
grader.cpp:(.text+0xc0): multiple definition of `Query(std::vector<int, std::allocator<int> > const&)'; /tmp/ccZHZ2at.o:chameleon.cpp:(.text+0x2b0): first defined here
collect2: error: ld returned 1 exit status