# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1055267 | 2024-08-12T16:09:07 Z | Ahmed57 | Mechanical Doll (IOI18_doll) | C++17 | 17 ms | 7480 KB |
#include "bits/stdc++.h" #include "doll.h" using namespace std; int S = -1; vector<int> X,Y,C; vector<int> dc(vector<int> lol){ if(lol.size()==1)return lol; int sz = lol.size(); int add = (sz+1)/2; vector<int> ret; for(int j = 0;j+add<sz;j++){ ret.push_back(S--); X.push_back(lol[j]); Y.push_back(lol[j+add]); } if(sz%2){ int x = sz-add; X.push_back(S); Y.push_back(lol[x]); ret.push_back(S--); } return ret; } void create_circuit(int M, vector<int> A){ vector<int> adj[M+1]; adj[0].push_back(A[0]); for(int i = 1;i<A.size();i++){ adj[A[i-1]].push_back(A[i]); } adj[A[M-1]].push_back(0); for(int i = 0;i<=M;i++){ if(adj[i].empty())adj[i].push_back(0); vector<int> x = dc(adj[i]); C.push_back(x[0]); } answer(C,X,Y); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 17 ms | 7480 KB | state 'Y' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 17 ms | 7480 KB | state 'Y' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 17 ms | 7480 KB | state 'Y' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |