This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Model solution (verification) | |
Task: hac | |
Complexity: O(n) | |
Author: Bartosz Kostka | |
*/ | |
#include "bits/stdc++.h" | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Task: Hacker | |
Model Solution 2 | |
Author: Krzysztof Kiljan | |
Complexity: O(n log n) | |
Uses segment tree to calculate maximum | |
*/ | |
#include <algorithm> | |
#include <cstdio> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |