Submission #312059

#TimeUsernameProblemLanguageResultExecution timeMemory
312059talant117408자동 인형 (IOI18_doll)C++17
16 / 100
109 ms13464 KiB
#include "doll.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair <ll, ll> pii; #define precision(n) fixed << setprecision(n) #define pb push_back #define ub upper_bound #define lb lower_bound #define mp make_pair #define eps (double)1e-9 #define PI 2*acos(0.0) #define endl "\n" #define sz(v) (int)(v).size() #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() #define do_not_disturb ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); vector <vector <int>> after; vector <int> connected, x, y; void create_circuit(int M, vector<int> A){ int i; after.resize(M+1); connected.resize(M+1); A.pb(0); connected[0] = A[0]; int n = sz(A); for(i = 0; i < n-1; i++){ after[A[i]].pb(A[i+1]); } int s = 0; for(i = 1; i <= M; i++){ auto saizu = sz(after[i]); if(!saizu){ } else if(saizu == 1){ connected[i] = after[i][0]; } else if(saizu == 2){ connected[i] = --s; x.pb(after[i][0]); y.pb(after[i][1]); } else if(saizu <= 4){ connected[i] = --s; x.pb(--s); y.pb(--s); if(saizu == 4){ x.pb(after[i][0]); y.pb(after[i][2]); x.pb(after[i][1]); y.pb(after[i][3]); } else{ x.pb(connected[i]); y.pb(after[i][1]); x.pb(after[i][0]); y.pb(after[i][2]); } } } /* for(auto to : connected) cout << to << ' '; cout << endl; for(i = 0; i < sz(x); i++) cout << x[i] << ' ' << y[i] << endl; */ answer(connected, 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...