Submission #116373

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1163732019-06-12 10:57:32zubecMechanical Doll (IOI18_doll)C++14
10 / 100
2 ms204 KiB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
int dir[N*4], n, sz;
pair<int, int> pr[N];
void add(int v, int l, int r, int x){
if (l == r){
//cout << "kek " << v << ' ' << v/2-sz/2+1 << ' ' << x << endl;
if (v % 2 == 0)
pr[v/2-sz/2+1].first = x; else
pr[v/2-sz/2+1].second = x;
return;
}
int mid = (l+r)>>1;
if (dir[v] == 0)
add(v+v, l, mid, x); else
add(v+v+1, mid+1, r, x);
dir[v] ^= 1;
}
void create_circuit(int M, std::vector<int> A) {
n = A.size();
vector <int> C, X, Y;
if (n == 1){
C.push_back(A[0]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:53:9: warning: unused variable 'kol' [-Wunused-variable]
   53 |     int kol = 0;
      |         ^~~
#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...