Submission #532882

# Submission time Handle Problem Language Result Execution time Memory
532882 2022-03-04T07:33:28 Z Koosha_mv Minerals (JOI19_minerals) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
#define dbgv(v) cout<<#v<<" = "; f(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define dbga(a,x,y) cout<<#a<<" = "; f(i,x,y) cout<<a[i]<<" "; cout<<endl
#define erorp(x) cout<<#x<<"={"<<(x.F)<<" , "<<x.S<<"}"<<endl
#define eror(x) cout<<#x<<'='<<(x)<<endl
#define f_(i,a,b) for(int i=a;i>=b;i--)
#define f(i,a,b) for(int i=a;i<b;i++)
#define nb(x) __builtin_popcount(x)
#define all(v) v.begin(),v.end()
#define bit(n,k) (((n)>>(k))&1)
#define Add(x,y) x=(x+y)%mod
#define maxm(a,b) a=max(a,b)
#define minm(a,b) a=min(a,b)
#define lst(x) x[x.size()-1]
#define sz(x) int(x.size())
#define mp make_pair
#define ll long long
#define pb push_back
#define S second
#define F first
#include "minerals.h"

const int N=1e5+99;

int n,last,a[N],s[N],t[N],mark[N];

/*void Answer(int a, int b){
	cout<<a<<" edge "<<b<<endl;
}
int Query(int x){
	int res=0;
	mark[x]^=1;
	f(i,1,n+1) if(mark[s[i]] || mark[t[i]]) res++;
	cout<<"? "<<x<<" "<<res<<endl;
	return res;
}*/
bool ask(int x){
	int p=Query(x),res=(p!=last);
	last=p;
	return res;
}
void reset(){
	f(i,1,2*n+1) ask(i);
}
void solve(int N){
	vector<int> A,B;
	n=N,last=0;
	f(i,1,2*n+1){
		if(ask(i)) A.pb(i);
		else B.pb(i);
	}
	reset();
	f(i,0,A.size()){
		f(j,0,B.size()){
			if(ask(A[i])==1 && ask(B[j])==0){
				Answer(A[i],B[j]);
			}
			ask(A[i]);
			ask(B[j]);
		}
	}
}
/*
main(){
	int n;
	cin>>n;
	f(i,1,n+1){
		cin>>s[i]>>t[i];
	}
	solve(n);
}*/

Compilation message

minerals.cpp: In function 'void solve(int)':
minerals.cpp:8:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 | #define f(i,a,b) for(int i=a;i<b;i++)
......
   54 |  f(i,0,A.size()){
      |    ~~~~~~~~~~~~                
minerals.cpp:54:2: note: in expansion of macro 'f'
   54 |  f(i,0,A.size()){
      |  ^
minerals.cpp:8:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 | #define f(i,a,b) for(int i=a;i<b;i++)
......
   55 |   f(j,0,B.size()){
      |     ~~~~~~~~~~~~               
minerals.cpp:55:3: note: in expansion of macro 'f'
   55 |   f(j,0,B.size()){
      |   ^
/usr/bin/ld: /tmp/ccph0tij.o: in function `main':
grader.cpp:(.text.startup+0xbd): undefined reference to `Solve(int)'
collect2: error: ld returned 1 exit status