Submission #605166

# Submission time Handle Problem Language Result Execution time Memory
605166 2022-07-25T13:35:48 Z Red_Inside ICC (CEOI16_icc) C++17
0 / 100
5 ms 468 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 as1[200], as2[200];

int quer(int n, int m, vector <int> a, vector <int> b)
{
	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 '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)
......
   64 |     FOR(0, j, i.size() / 2) fi.pb(i[j]);
      |            ~~~~~~~~~~~~~~~             
icc.cpp:64:5: note: in expansion of macro 'FOR'
   64 |     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)
......
   65 |     FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
      |                       ~~~~~~~~~~~      
icc.cpp:65:5: note: in expansion of macro 'FOR'
   65 |     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)
......
   74 |      FOR(0, j, i.size() / 2) V.pb(i[j]);
      |             ~~~~~~~~~~~~~~~            
icc.cpp:74:6: note: in expansion of macro 'FOR'
   74 |      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)
......
   77 |      FOR(i.size() / 2, j, i.size()) V.pb(i[j]);
      |                        ~~~~~~~~~~~     
icc.cpp:77:6: note: in expansion of macro 'FOR'
   77 |      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)
......
   90 |    FOR(0, i, sts.size() / 2)
      |           ~~~~~~~~~~~~~~~~~            
icc.cpp:90:4: note: in expansion of macro 'FOR'
   90 |    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)
......
   97 |     FOR(0, j, i.size() / 2) fi.pb(i[j]);
      |            ~~~~~~~~~~~~~~~             
icc.cpp:97:5: note: in expansion of macro 'FOR'
   97 |     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)
......
   98 |     FOR(i.size() / 2, j, i.size()) se.pb(i[j]);
      |                       ~~~~~~~~~~~      
icc.cpp:98:5: note: in expansion of macro 'FOR'
   98 |     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)
......
  104 |     FOR(sts.size() / 2, i, sts.size()) V.pb(sts[i]);
      |                         ~~~~~~~~~~~~~  
icc.cpp:104:5: note: in expansion of macro 'FOR'
  104 |     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)
......
  109 |   FOR(0, i, sts[0].size() / 2)
      |          ~~~~~~~~~~~~~~~~~~~~          
icc.cpp:109:3: note: in expansion of macro 'FOR'
  109 |   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)
......
  113 |   FOR(sts[0].size() / 2, i, sts[0].size())
      |                          ~~~~~~~~~~~~~~~~
icc.cpp:113:3: note: in expansion of macro 'FOR'
  113 |   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)
......
  121 |    FOR(0, i, fi.size() / 2)
      |           ~~~~~~~~~~~~~~~~             
icc.cpp:121:4: note: in expansion of macro 'FOR'
  121 |    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)
......
  129 |     FOR(fi.size() / 2, i, fi.size())
      |                        ~~~~~~~~~~~~    
icc.cpp:129:5: note: in expansion of macro 'FOR'
  129 |     FOR(fi.size() / 2, i, fi.size())
      |     ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 468 KB Wrong road!
2 Halted 0 ms 0 KB -