Submission #528257

#TimeUsernameProblemLanguageResultExecution timeMemory
528257happypotatoArt Exhibition (JOI18_art)C++17
Compilation error
0 ms0 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; const int mxN = 2e5 + 1; int seg[4 * mxN]; int n; void update(int tar, int l = 0, int r = n * 4 - 1, int idx = 1) { if (l == r) { seg[idx] ^= 1; return; } int mid = (l + r) >> 1; if (tar <= mid) update(tar, l, mid, (idx << 1)); else update(tar, mid + 1, r, (idx << 1) + 1); seg[idx] = seg[(idx << 1)] + seg[(idx << 1) + 1]; return; } int query(int tarl, int tarr, int l = 0, int r = n * 4 - 1, int idx = 1) { if (tarl <= l && r <= tarr) return seg[idx]; else if (tarr < l || r < tarl) return 0; int mid = (l + r) >> 1; return query(tarl, min(tarr, mid), l, mid, (idx << 1)) + query(max(tarl, mid + 1), tarr, mid + 1, r, (idx << 1) + 1); } long long count_swaps(vector<int> s) { n = s.size() / 2; queue<int> q[n + 1]; for (int i = 0; i < n * 2; i++) { if (s[i] < 0) q[-s[i]].push(i * 2 + 1); } for (int i = 0; i < n * 2; i++) update(2 * i + 1); long long ans = 0; for (int i = 0; i < n * 2; i++) { if (s[i] < 0) continue; int tar = q[s[i]].front(); q[s[i]].pop(); ans += query(i * 2 + 1, tar - 1); update(tar); update(i * 2); } return ans; }

Compilation message (stderr)

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