Submission #987640

#TimeUsernameProblemLanguageResultExecution timeMemory
987640ThylOneMonster Game (JOI21_monster)C++17
0 / 100
1 ms344 KiB
#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++) ans[i] = i; return solve(id); }

Compilation message (stderr)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...