# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1026940 | 2024-07-18T14:22:02 Z | nisanduu | 자동 인형 (IOI18_doll) | C++14 | 72 ms | 9284 KB |
#include "doll.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; void create_circuit(int M, std::vector<int> A) { int N = A.size(); ll inf = 1e9; std::vector<int> C(M + 1,inf); vector<int> X,Y; map<int,int> mp; vector<int> unused; int sz = A.size(); int crMinus = -1; C[0] = crMinus; Y.push_back(A[0]); X.push_back(crMinus); crMinus--; //A.push_back(0); int ind=1; for(int i=0;i<(A.size()-1);i++){ //C[A[i]] = A[i+1]; if(mp[A[i]]){ int node = Y[mp[A[i]]]; Y[mp[A[i]]] = A[i+1]; X[mp[A[i]]] = node; continue; } C[A[i]] = crMinus; Y.push_back(A[i+1]); X.push_back(crMinus); mp[A[i]] = ind; ind++; crMinus--; } C[A[sz-1]]=0; for(int i=0;i<(M+1);i++){ if(C[i]==inf){ unused.push_back(i); } } sz = unused.size(); for(int i=0;i<(sz-1);i++){ C[unused[i]] = unused[i+1]; } if(sz>0){ C[unused[sz-1]] = 0; } //std::vector<int> X(N), Y(N); answer(C, X, Y); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 40 ms | 6740 KB | Output is correct |
3 | Correct | 37 ms | 6356 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 7 ms | 2000 KB | Output is correct |
6 | Correct | 72 ms | 9284 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 40 ms | 6740 KB | Output is correct |
3 | Correct | 37 ms | 6356 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 7 ms | 2000 KB | Output is correct |
6 | Correct | 72 ms | 9284 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 68 ms | 6752 KB | wrong motion |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 344 KB | Output is correct |
2 | Correct | 40 ms | 6740 KB | Output is correct |
3 | Correct | 37 ms | 6356 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 7 ms | 2000 KB | Output is correct |
6 | Correct | 72 ms | 9284 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Incorrect | 68 ms | 6752 KB | wrong motion |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | wrong motion |
2 | Halted | 0 ms | 0 KB | - |