# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
827349 | 2023-08-16T11:42:14 Z | vjudge1 | Art Collections (BOI22_art) | C++17 | 1 ms | 268 KB |
#include<iostream> #include<vector> #include<numeric> #include"art.h" // Don't forget to uncomment! using namespace std; typedef vector<int> vi; /* int publish(vi R) { for(int& i : R)cout << i << ' ';cout << endl;// COMMENT OUT int w; cin >> w; return w; } */ /* void answer(vi R) { for(int& i : R)cout << i << ' ';cout << endl; } */ void solve(int N) { vi ans(N); iota(ans.begin(), ans.end(), 1ll); int w = publish(ans); for(int i = 0; i < N; i++) { int icpy = i; for(int j = 0; j < N; ++j) { if(j == i)continue; swap(ans[i], ans[j]); int new_w = publish(ans); if(new_w == 0) { answer(ans); return; // maybe comment out? idk } if(new_w < w) { w = new_w; i = j; } else swap(ans[i], ans[j]); } i = icpy; } } /* int main() { solve(4); } */
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 268 KB | Output is correct |
2 | Incorrect | 1 ms | 220 KB | Security violation! |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 268 KB | Output is correct |
2 | Incorrect | 1 ms | 220 KB | Security violation! |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 268 KB | Output is correct |
2 | Incorrect | 1 ms | 220 KB | Security violation! |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 268 KB | Output is correct |
2 | Incorrect | 1 ms | 220 KB | Security violation! |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 268 KB | Output is correct |
2 | Incorrect | 1 ms | 220 KB | Security violation! |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 268 KB | Output is correct |
2 | Incorrect | 1 ms | 220 KB | Security violation! |
3 | Halted | 0 ms | 0 KB | - |