Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am lundstig on github.
* I am lundstig (https://keybase.io/lundstig) on keybase.
* I have a public key ASClE7PejKYbLfPjLpi7X6cyX1IrwEpZpn3IC-1rLhTSKAo
To claim this, I am signing this object:
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using vpii = vector<pii>;
/*
Model solution (verification)
Task: hac
Complexity: O(n)
Author: Bartosz Kostka
*/
#include "bits/stdc++.h"
using namespace std;
/*
Task: Hacker
Model Solution 2
Author: Krzysztof Kiljan
Complexity: O(n log n)
Uses segment tree to calculate maximum
*/
#include <algorithm>
#include <cstdio>
#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
#define rep(x, s, e) for (int x = (int)s; x < (int)e; ++x)
int main() {
int w, h;
#include <bits/stdc++.h>
using namespace std;
#define rep(x, s, e) for (int x = int(s); x < int(e); ++x)
int n;
vector<bool> visited;
vector<pair<int, int>> snow;
void dfs(int cur) {
@lundstig
lundstig / asphalting_roads.cpp
Last active March 14, 2019 11:17
Saudi IOI Day 4
#include <bits/stdc++.h>
#define rep(x, s, e) for (int x = int(s); x < int(e); ++x)
using namespace std;
int main() {
int n;
cin >> n;
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, k;
cin >> n >> k;
vector<int> h(n);
for (int i = 0; i < n; ++i) {
#include <bits/stdc++.h>
#define rep(x, s, e) for (int x = int(s); x < int(e); ++x)
using namespace std;
int main() {
string s;
cin >> s;