Submission #384911

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3849112021-04-02 15:59:16arman_ferdousMechanical Doll (IOI18_doll)C++17
6 / 100
98 ms12508 KiB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
#define sz(v) (int)v.size()
const int M = 1e5+10; // triggers
vector<int> g[M];
void create_circuit(int m, vector<int> a) {
a.push_back(0);
int n = a.size();
for(int i = 0; i < n - 1; i++) {
g[a[i]].push_back(a[i + 1]);
}
vector<int> C, X, Y; C.push_back(a[0]);
for(int i = 1; i <= m; i++) {
assert(sz(g[i]) <= 2);
if(g[i].empty()) {
C.push_back(0);
continue;
}
C.push_back(- sz(X) - 1);
if(sz(g[i]) == 1) {
X.push_back(- sz(Y) - 1);
Y.push_back(g[i][0]);
}
else {
X.push_back(g[i][0]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...