Submission #944970

# Submission time Handle Problem Language Result Execution time Memory
944970 2024-03-13T09:11:58 Z Xiaoyang Chameleon's Love (JOI20_chameleon) C++17
4 / 100
18 ms 600 KB
#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
#define fi first 
#define se second 
#define pll pair<ll,ll>
#define pb push_back
#define debug(x) cerr<<#x<<"="<<x<<endl;
#define MP make_pair
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define SZ(x) (ll)x.size()
#define ALL(x) x.begin(),x.end()
#define endl "\n"
const ll inf=1e18;
ll lowbit(ll x){return x&(-x);}
 
 
void Solve(int n) {
	vector<int>a;
	rep(i,1,2*n+1)a.pb(i);
	while(!a.empty()){
		ll lo=0,hi=a.size();
		while(lo<hi){
			ll mid=lo+hi+1>>1;
			ll x= Query(vector(a.begin(),a.begin()+mid));
			ll y = Query(vector(a.begin()+1,a.begin()+mid));
			if(x==y)hi=mid-1;
			else lo=mid;
		}
		ll xx=a[0],yy=a[lo];
		a.erase(a.begin());
		a.erase(a.begin()+lo-1);
		Answer(xx,yy);
	}
}

Compilation message

chameleon.cpp: In function 'void Solve(int)':
chameleon.cpp:27:16: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   27 |    ll mid=lo+hi+1>>1;
      |           ~~~~~^~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 17 ms 344 KB Output is correct
4 Correct 17 ms 344 KB Output is correct
5 Correct 18 ms 484 KB Output is correct
6 Correct 16 ms 484 KB Output is correct
7 Correct 17 ms 600 KB Output is correct
8 Correct 17 ms 344 KB Output is correct
9 Correct 17 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 0 ms 344 KB Wrong Answer [6]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 17 ms 344 KB Output is correct
4 Correct 17 ms 344 KB Output is correct
5 Correct 18 ms 484 KB Output is correct
6 Correct 16 ms 484 KB Output is correct
7 Correct 17 ms 600 KB Output is correct
8 Correct 17 ms 344 KB Output is correct
9 Correct 17 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Incorrect 0 ms 344 KB Wrong Answer [6]
12 Halted 0 ms 0 KB -