Submission #661862

# Submission time Handle Problem Language Result Execution time Memory
661862 2022-11-26T05:26:07 Z victor_gao Monster Game (JOI21_monster) C++17
0 / 100
201 ms 288 KB
//#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;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 201 ms 288 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -