Submission #289924

#TimeUsernameProblemLanguageResultExecution timeMemory
289924dandrozavrMechanical Doll (IOI18_doll)C++14
Compilation error
0 ms0 KiB
#include "grader.h" #include <vector> #include <iostream> #define pb push_back #define F first #define S second #define _ <<" "<< #define pii pair < int , int > using namespace std; void create_circuit (int m, vector < int > a) { int n = a.size(); a.pb(0); vector < int > c; vector < int > g[n + 1]; for (int i = 1; i <= n; ++i){ g[a[i - 1]].pb(a[i]); } g[0].pb(a[0]); int now = 1; vector < pii > swit; for (int i = 0; i <= n; ++i){ int sz = g[i].size(); cout << i _ sz << endl; if (!sz){ c.pb(0); continue; } if (sz == 1){ c.pb(g[i][0]); } else { vector < int > all; for (int j = 0; j < sz; ++j){ all.pb(g[i][j]); } while(all.size() > 1){ vector < int > nall; for (int i = 0; i < all.size(); i += 2){ int Pr = swit.size() + 1; swit.pb({all[i], all[i + 1]}); nall.pb(-Pr); } if (all.size() % 2){ nall.pb(all.back()); } swap(nall, all); } c.pb(all[0]); } } // for (int i : c) cout << i << " "; // cout << endl; vector < int > X, Y; for (int i = 0; i < swit.size(); ++i){ X.pb(swit[i].F), Y.pb(swit[i].S); // cout << X.back() _ Y.back() << endl; } answer(c, X, Y); }

Compilation message (stderr)

doll.cpp:1:10: fatal error: grader.h: No such file or directory
    1 | #include "grader.h"
      |          ^~~~~~~~~~
compilation terminated.