Submission #1024434

# Submission time Handle Problem Language Result Execution time Memory
1024434 2024-07-16T05:09:01 Z 12345678 Monster Game (JOI21_monster) C++17
0 / 100
115 ms 420 KB
#include "monster.h"
#include <bits/stdc++.h>

using namespace std;

std::vector<int> Solve(int N) {
  std::vector<int> T(N), cnt(N);
  for (int i=0; i<N; i++) 
  {
    for (int j=i+1; j<N; j++) 
    {
      if (Query(i, j)) cnt[i]++;
      else cnt[j]++;
    }
  }
  vector<pair<int, int>> v;
  for (int i=0; i<N; i++) v.push_back({cnt[i], i});
  sort(v.begin(), v.end());
  for (int i = 0; i < N; i++) T[v[i].second] = i;
  //for (int i=0; i<N; i++) cout<<"t "<<T[i]<<'\n';
  int a=v[2].second;
  if (Query(v[0].second, a)) swap(T[v[0].second], T[v[1].second]);
  a=v[N-3].second;
  if (Query(v[N-2].second, a)) swap(T[v[N-2].second], T[v[N-1].second]);
  return T;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 115 ms 420 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -