Submission #987641

# Submission time Handle Problem Language Result Execution time Memory
987641 2024-05-23T08:44:58 Z ThylOne Monster Game (JOI21_monster) C++17
0 / 100
5 ms 704 KB
#include "monster.h"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back 
vector<int> solve(vector<int> id){
  int pivot_pos = ((int)id.size())%((int)id.size());
  vector<int> left,right;
  for(int i = 0;i<id.size();i++){
    if(i==pivot_pos)continue;
    if(Query(id[pivot_pos],id[i])){
      left.pb(id[i]);
    }else{
      right.pb(id[i]);
    }
  }
  int l_back = left.back();
  int r_begin = *(right.begin());
  left[left.size()-1] = r_begin;
  right[0] = l_back;
  vector<int> ans;
  for(int v:left)ans.pb(v);
  ans.pb(id[pivot_pos]);
  for(int v:right)ans.pb(v);
  return ans;
}
std::vector<int> Solve(int N) {
  std::vector<int> ans(N);
  vector<int> id(N);
  for(int i = 0;i<N;i++)
    id[i] = i;
  return solve(id);
}

Compilation message

monster.cpp: In function 'std::vector<int> solve(std::vector<int>)':
monster.cpp:8:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |   for(int i = 0;i<id.size();i++){
      |                 ~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 KB Output is correct
2 Incorrect 3 ms 344 KB Wrong Answer [3]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 344 KB Output is correct
2 Incorrect 3 ms 344 KB Wrong Answer [3]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 704 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -