Submission #892554

# Submission time Handle Problem Language Result Execution time Memory
892554 2023-12-25T13:41:27 Z Minbaev Super Dango Maker (JOI22_dango3) C++17
0 / 100
1 ms 856 KB
#include "dango3.h"
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimize("Ofast,unroll-loops")
#define pii pair<int,int>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define f first
#define s second
#define pii pair<int,int>
template<class T>bool umax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T>bool umin(T &a,T b){if(b<a){a=b;return true;}return false;}
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
	tree_order_statistics_node_update> ordered_set;
const int mod= 1e9 +7;
const int N=1e5*4;
 
 
void Solve(int n,int m){
	
	int cnt = m;	
	
	while(cnt>0){
		
		int l = 1,r = n*m,ans = 0;
		vector<int>vis(n*m+1);
		while(l<=r){
			int mid = (l+r) >> 1;
			
			vector<int>vs;
			for(int i = 1;i<=mid;i++){
				if(!vis[i])
				vs.pb(i);
			}
			vector<int>ans1(vs.size());
			for(auto &to:vs)ans1.pb(to);
			int x = Query(ans1);
			
			if(x>1){
				r = mid - 1;
			}
			else if(x==1){
				ans = mid;
				break;
			}
			else l = mid + 1;
		}
		
		vector<int>vs;
		
		for(int i = 1;i<=ans;i++){
			if(!vis[i])
			vs.pb(i);
			vis[i] = 1;
		}
		
		vector<int>ans1(vs.size());
		
		for(auto &to:vs)ans1.pb(to);
		
		Answer(ans1);
		
		
		
		
	}
	
	
	
	
	
	
	
	
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 856 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -