//#pragma GCC optimize("Ofast,unroll-loops,O3")
//#pragma GCC optimize("avx,avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,fma,tune=native")
#include "monster.h"
#include<bits/stdc++.h>
#define pii pair<int,int>
#define x first
#define y second
using namespace std;
vector<int> Solve(int N){
map<pii,vector<int> >mp;
vector<int>ans;
ans.resize(N,0);
for (int i=0;i<N;i++){
int cntw=0,cntl=0;
for (int j=i+1;j<N;j++){
if (Query(i,j)) cntw++;
else cntl++;
}
mp[{cntw,cntl}].push_back(i);
}
for (auto i:mp){
if (i.y.size()==1)
ans[i.y[0]]=i.x.x;
else {
int a=i.y[0],b=i.y[1];
if (Query(a,b)){
ans[a]=i.x.x-1;
ans[b]=i.x.x;
}
else {
ans[b]=i.x.x-1;
ans[a]=i.x.x;
}
}
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
208 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
201 ms |
288 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |