This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "koala.h"
#include <bits/stdc++.h>
#define pb push_back
#define fst first
#define snd second
#define fore(i,a,b) for(ll i=a,mxcont=b;i<mxcont;i++)
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(),x.end()
#define mset(a,v) memset((a),(v),sizeof(a))
#define imp(v) {for(auto jfhg:v)cout<<jfhg;cout<<"\n";}
using namespace std;
typedef int ll;
typedef pair<ll,ll> ii;
random_device rd;
mt19937 rng(rd());
int minValue(int N, int W) {
return N+W;
}
int maxValue(int N, int W) {
return N+W;
}
int greaterValue(int n, int w) {
ll res=-1;
auto qan=[&](ll x)->int{
// cout<<"qan "<<x<<"\n";
vector<ll>B(n),R(n);
B[0]=B[1]=x;
playRound(B.data(),R.data());
// imp(B); imp(R);
vector<ll>s(n);
fore(i,0,n)s[i]=R[i]>B[i];
// imp(s);
if(s[0]!=s[1])res=s[0]<s[1];
return s[0]+s[1];
};
ll l=1,r=8;
while(l<=r){
ll m=(l+r)/2;
if(qan(m)==2)l=m+1;
else r=m-1;
}
return res;
}
void allValues(int N, int W, int *P) {
assert(P[0]);
if (W == 2*N) {
// TODO: Implement Subtask 4 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
} else {
// TODO: Implement Subtask 5 solution here.
// You may leave this block unmodified if you are not attempting this
// subtask.
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |