제출 #286244

#제출 시각아이디문제언어결과실행 시간메모리
286244mohammad자동 인형 (IOI18_doll)C++14
0 / 100
3 ms2636 KiB
#include "doll.h" #include<bits/stdc++.h> using namespace std; #define endl "\n" // #define int long long typedef long long ll ; const ll ooo = 1e14 ; const ll oo = 2e9 ; const double PI = acos(-1) ; const ll M = 1e9 + 7 ; const int N = 10000010 ; int use[100010]; vector<int> v[100010]; void create_circuit(int M, vector<int> A) { int N = A.size(); vector<int> c(M + 1 , 0); for(int i = 0 ; i < N ; ++i){ if(!i)v[0].push_back(A[i]); else v[A[i - 1]].push_back(A[i]); } v[A[N - 1]].push_back(0); vector<int> x , y; int co = -1; for(int i = 0 ; i < M + 1 ; ++i){ if(!v[i].size()) continue ; cout << i << ' ' << v[i].size() << endl; if(v[i].size() == 1){ c[i] = v[i][0]; }else if(v[i].size() == 2){ c[i] = co--; x.push_back(v[i][0]); y.push_back(v[i][1]); }else if(v[i].size() == 3){ c[i] = co--; x.push_back(co--); y.push_back(co); x.push_back(v[i][0]); y.push_back(v[i][1]); x.push_back(co + 2); y.push_back(v[i][2]); co--; }else{ c[i] = co--; x.push_back(co--); y.push_back(co--); x.push_back(v[i][0]); y.push_back(v[i][2]); x.push_back(v[i][1]); y.push_back(v[i][3]); } // cout << c[i] << endl; } answer(c, x, y); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...