답안 #589666

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
589666 2022-07-05T05:54:54 Z Red_Inside Super Dango Maker (JOI22_dango3) C++17
0 / 100
112 ms 612 KB
#include "dango3.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 sortv(vv) sort(vv.begin(), vv.end())
#define all(v) v.begin(), v.end()
#define ld long double
#define ull unsigned long long
 
using namespace std;
const int maxn=1e6+100,LOG=17, mod=1e9+7;
int block = 320, 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=1e9+10;
#define y1 yy
#define prev pre
#define pii pair <int, int>


void Solve(int n, int m)
{
	vector <int> use;
	forn(1, i, n*m)
	{
		use.pb(i);
	}
	forn(1, iter, m)
	{
		vector <int> que, fin;
		int l = 0;
		forn(1, i, n)
		{
			int r = use.size();
			while(r - l > 1)
			{
				int mid = (l + r) / 2;
				que.clear();
				FOR(0, j, mid)
				{
					que.pb(use[j]);
				}
				for(auto j : fin) que.pb(j);
				if(Query(que) >= 1)
				{
					r = mid;
				}
				else
				{
					l = mid;
				}
			}
//			for(auto j : use) cout << j << " ";
//			cout << endl;
//			cout << "binsearch " << use[l] << endl;
			fin.pb(use[l]);
			vector <int> nw;
			FOR(0, j, l) nw.pb(use[j]);
			FOR(l + 1, j, use.size()) nw.pb(use[j]);
			use = nw;
			l = max(0, l - 1);
		}
//		cout << "ANSWER ";
//		for(auto i : fin) cout << i << " ";
//		cout << endl;
		Answer(fin);
	}
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:12:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 | #define FOR(i, j, n) for(int j = i; j < n; ++j)
......
   73 |    FOR(l + 1, j, use.size()) nw.pb(use[j]);
      |               ~~~~~~~~~~~~~            
dango3.cpp:73:4: note: in expansion of macro 'FOR'
   73 |    FOR(l + 1, j, use.size()) nw.pb(use[j]);
      |    ^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 340 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 25 ms 468 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 112 ms 612 KB Wrong Answer [7]
2 Halted 0 ms 0 KB -