# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
987640 | 2024-05-23T08:44:32 Z | ThylOne | Monster Game (JOI21_monster) | C++17 | 1 ms | 344 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++) ans[i] = i; return solve(id); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [5] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [5] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Wrong Answer [5] |
2 | Halted | 0 ms | 0 KB | - |