# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
95731 | 2019-02-02T08:32:46 Z | tqbfjotld | 자동 인형 (IOI18_doll) | C++14 | 62 ms | 5180 KB |
#include "doll.h" #include <vector> #include <utility> using namespace std; pair<int,int> ans2[100005]; int ans[100005]; using namespace std; void create_circuit(int M, std::vector<int> A) { vector<int> X; vector<int> Y; for (int x = 0; x<M+1; x++){ ans2[x].first = -x; ans2[x].second = -x; } for (int x = 0; x<A.size()-1; x++){ if (ans2[A[x]].second == A[x]){ ans2[A[x]].second = A[x+1]; } else{ ans2[A[x]].first = ans2[A[x]].second; ans2[A[x]].second = A[x+1]; } } if (ans2[A[A.size()-1]].second == -A[A.size()-1]){ ans2[A[A.size()-1]].second = 0; } else{ ans2[A[A.size()-1]].first = ans2[A[A.size()-1]].second; ans2[A[A.size()-1]].second = 0; } vector<int> C; for (int x = 0; x<M+1; x++){ C.push_back(-x); if (x==0) continue; X.push_back(ans2[x].first); Y.push_back(ans2[x].second); } C[0] = A[0]; answer(C, X, Y); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Incorrect | 62 ms | 5180 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Incorrect | 62 ms | 5180 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Incorrect | 62 ms | 5180 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |