# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
877536 | 2023-11-23T09:48:14 Z | AndrijaM | Art Collections (BOI22_art) | C++17 | 0 ms | 344 KB |
#include "art.h" #include <bits/stdc++.h> using namespace std; const int maxn = 1e5; const int mod = 1e9+7; const int logn=30; void solve(int n) { vector<int>v; for(int i=0;i<n;i++) { v.push_back(i+1); } int prev=publish(v); int p=1; swap(v[0],v[1]); for(int i=0;i<n;i++) { while(true) { int kolku=publish(v); if(kolku==0) { answer(v); } if(kolku>prev) { swap(v[i],v[p]); break; } int koj=v[i]+1; int P=-1; for(int pos=0;pos<v.size();pos++)///moze i so mapa da najdeme kade e vo log(n) { if(v[pos]==koj) { P=pos; break; } } p=P; swap(v[i],v[P]); } } answer(v); /// publish(order); /// answer(order); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 0 ms | 344 KB | Not correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 0 ms | 344 KB | Not correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 0 ms | 344 KB | Not correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 0 ms | 344 KB | Not correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 0 ms | 344 KB | Not correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 0 ms | 344 KB | Output is correct |
3 | Incorrect | 0 ms | 344 KB | Not correct |
4 | Halted | 0 ms | 0 KB | - |