Submission #605182

# Submission time Handle Problem Language Result Execution time Memory
605182 2022-07-25T13:40:54 Z Red_Inside ICC (CEOI16_icc) C++17
Compilation error
0 ms 0 KB
//
//#include "icc.h"
#include <bits/stdc++.h>

#define ll long long
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define o cout<<"BUG"<<endl;
#define FOR(i, j, n) for(int j = i; j < n; ++j)
#define forn(i, j, n) for(int j = i; j <= n; ++j)
#define nfor(i, j, n) for(int j = n; j >= i; --j)
#define all(v) v.begin(), v.end()
#define ld long double
#define ull unsigned long long

using namespace std;
const int maxn=2e6+100,LOG=17,mod=1e9+7;
int block = 226, timer = 0;
const ld EPS = 1e-18;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define bt(i) (1 << (i))
//#define int ll
const int inf=2e9;
#define y1 yy
#define prev pre
#define pii pair <int, int>

int quer(int n, int m, vector <int> a, vector <int> b)
{
    int* as1=new int[a.size()],*as2=new int[b.size()];
	FOR(0, i, n)
	{
		as1[i] = a[i];
	}
	FOR(0, i, m)
	{
		as2[i] = b[i];
	}
	return query(n, m, as1, as2);
}

void run(int n)
{
	forn(1, iter, n-1)
	{
		vector <int> temp;
		forn(1, i, n)
		{
			temp.pb(i);
		}
		vector <vector <int> > sts;
		sts.pb(temp);
		int ret = 0;
		while(true)
		{
			vector <int> fi, se;
			for(auto i : sts)
			{
				FOR(0, j, i.size() / 2) fi.pb(i[j]);
				FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
			}
			ret = quer(fi.size(), se.size(), fi, se);
			if(ret == 0)
			{
				vector <vector <int> > nw;
				for(auto i : sts)
				{
					vector <int> V;
					FOR(0, j, i.size() / 2) V.pb(i[j]);
					nw.pb(V);
					V.clear();
					FOR(i.size() / 2, j, i.size()) V.pb(i[j]);
					nw.pb(V);
				}
				sts = nw;
			}
			else
			{
				break;
			}
		}
		while(sts.size() > 1)
		{
			vector <vector <int> > V;
			FOR(0, i, sts.size() / 2)
			{
				V.pb(sts[i]);
			}
			vector <int> fi, se;
			for(auto i : V)
			{
				FOR(0, j, i.size() / 2) fi.pb(i[j]);
				FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
			}
			ret = quer(fi.size(), se.size(), fi, se);
			if(ret == 0)
			{
				V.clear();
				FOR(sts.size() / 2, i, sts.size()) V.pb(sts[i]);
			}
			sts = V;
		}
		vector <int> fi, se;
		FOR(0, i, sts[0].size() / 2)
		{
			fi.pb(sts[0][i]);
		}
		FOR(sts[0].size() / 2, i, sts[0].size())
		{
			se.pb(sts[0][i]);
		}
		while(fi.size() >= 2 || se.size() >= 2)
		{
			vector <int> qf, qs;
			if(fi.size() < se.size()) swap(fi, se);
			FOR(0, i, fi.size() / 2)
			{
				qf.pb(fi[i]);
			}
			ret = quer(qf.size(), se.size(), qf, se);
			if(ret == 0)
			{
				qf.clear();
				FOR(fi.size() / 2, i, fi.size())
				{
					qf.pb(fi[i]);
				}
			}
			fi = qf;
		}
		setRoad(fi[0], se[0]);
	}
}

Compilation message

icc.cpp: In function 'int quer(int, int, std::vector<int>, std::vector<int>)':
icc.cpp:43:9: error: 'query' was not declared in this scope; did you mean 'quer'?
   43 |  return query(n, m, as1, as2);
      |         ^~~~~
      |         quer
icc.cpp: In function 'void run(int)':
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   63 |     FOR(0, j, i.size() / 2) fi.pb(i[j]);
      |            ~~~~~~~~~~~~~~~             
icc.cpp:63:5: note: in expansion of macro 'FOR'
   63 |     FOR(0, j, i.size() / 2) fi.pb(i[j]);
      |     ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   64 |     FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
      |                       ~~~~~~~~~~~      
icc.cpp:64:5: note: in expansion of macro 'FOR'
   64 |     FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
      |     ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   73 |      FOR(0, j, i.size() / 2) V.pb(i[j]);
      |             ~~~~~~~~~~~~~~~            
icc.cpp:73:6: note: in expansion of macro 'FOR'
   73 |      FOR(0, j, i.size() / 2) V.pb(i[j]);
      |      ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   76 |      FOR(i.size() / 2, j, i.size()) V.pb(i[j]);
      |                        ~~~~~~~~~~~     
icc.cpp:76:6: note: in expansion of macro 'FOR'
   76 |      FOR(i.size() / 2, j, i.size()) V.pb(i[j]);
      |      ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   89 |    FOR(0, i, sts.size() / 2)
      |           ~~~~~~~~~~~~~~~~~            
icc.cpp:89:4: note: in expansion of macro 'FOR'
   89 |    FOR(0, i, sts.size() / 2)
      |    ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   96 |     FOR(0, j, i.size() / 2) fi.pb(i[j]);
      |            ~~~~~~~~~~~~~~~             
icc.cpp:96:5: note: in expansion of macro 'FOR'
   96 |     FOR(0, j, i.size() / 2) fi.pb(i[j]);
      |     ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   97 |     FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
      |                       ~~~~~~~~~~~      
icc.cpp:97:5: note: in expansion of macro 'FOR'
   97 |     FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
      |     ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
  103 |     FOR(sts.size() / 2, i, sts.size()) V.pb(sts[i]);
      |                         ~~~~~~~~~~~~~  
icc.cpp:103:5: note: in expansion of macro 'FOR'
  103 |     FOR(sts.size() / 2, i, sts.size()) V.pb(sts[i]);
      |     ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
  108 |   FOR(0, i, sts[0].size() / 2)
      |          ~~~~~~~~~~~~~~~~~~~~          
icc.cpp:108:3: note: in expansion of macro 'FOR'
  108 |   FOR(0, i, sts[0].size() / 2)
      |   ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
  112 |   FOR(sts[0].size() / 2, i, sts[0].size())
      |                          ~~~~~~~~~~~~~~~~
icc.cpp:112:3: note: in expansion of macro 'FOR'
  112 |   FOR(sts[0].size() / 2, i, sts[0].size())
      |   ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
  120 |    FOR(0, i, fi.size() / 2)
      |           ~~~~~~~~~~~~~~~~             
icc.cpp:120:4: note: in expansion of macro 'FOR'
  120 |    FOR(0, i, fi.size() / 2)
      |    ^~~
icc.cpp:11:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
  128 |     FOR(fi.size() / 2, i, fi.size())
      |                        ~~~~~~~~~~~~    
icc.cpp:128:5: note: in expansion of macro 'FOR'
  128 |     FOR(fi.size() / 2, i, fi.size())
      |     ^~~
icc.cpp:135:3: error: 'setRoad' was not declared in this scope
  135 |   setRoad(fi[0], se[0]);
      |   ^~~~~~~