Submission #767677

#TimeUsernameProblemLanguageResultExecution timeMemory
767677ono_de206Rectangles (IOI19_rect)C++14
Compilation error
0 ms0 KiB
#include "shoes.h"
#include<bits/stdc++.h>
using namespace std;

#define in insert
#define all(x) x.begin(),x.end()
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

// #define int long long
 
typedef long long ll;
typedef vector<int> vi;
typedef set<int> si;
typedef multiset<int> msi;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

const int mxn = 1e5 + 10;
int a[mxn];
queue<pair<int, int>> q[mxn][3];

long long count_swaps(vector<int> s) {
	int n = (int)s.size() * 2;
	for(int i = 1; i <= n; i++) {
		a[i] = s[i - 1];
	}
	int ret = 0;
	for(int i = 1; i <= n; i++) {
		if(a[i] > 0) {
			if(q[a[i]][0].size()) {
				int lst = q[a[i]][0].front();
				q[a[i]][0].pop();
				ans += (i - lst - 1) - (get(i) - get(lst));
				add(i, -1);
				add(lst, 1);
			} else {
				q[a[i]][1].push(i);
			}
		} else {
			if(q[a[i]][1].size()) {
				int lst = q[a[i]][1].front();
				q[a[i]][1].pop();
				ans += (i - lst) - (get(i) - get(lst));
				add(i, -1);
				add(lst, 1);
			} else {
				q[a[i]][0].push(i);
			}
		}
	}
	return ret;
}

Compilation message (stderr)

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