이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "monster.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll ttt;
const ll INF=1e18;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n,m,k;
vector<int> Solve(int NN) {
vector<int> a(NN);
n=NN;
if(n<=200){
int oo=-1,ot=-1,to=-1,tt=-1;
vector<int>cnt(n, 0);
for(int i=0;i<n;i++){
for(int j=i+1;j<n;j++){
bool res=Query(i,j);
if(res){
cnt[i]++;
}
else {
cnt[j]++;
}
}
if(cnt[i]==1){
if(oo==-1)oo=i;
else ot=i;
}
else if(cnt[i]==n-2){
if(to==-1)to=i;
else tt=i;
}
else{
a[i]=cnt[i];
}
}
// cout<<oo<<" "<<ot<<" "<<to<<" "<<tt<<endl;
if(Query(oo,ot)){
a[oo]=0,a[ot]=1;
}
else{
a[oo]=1,a[ot]=0;
}
if(Query(to,tt)){
a[to]=n-2,a[tt]=n-1;
}
else{
a[to]=n-1,a[tt]=n-2;
}
}
return a;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |