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
// https://onlinejudge.org/external/7/796.pdf | |
#include <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
#define watch(x) cout << (#x) << " is " << (x) << endl |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int maxn=(int)4e5+5; |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int maxn=(int)4e5+5; |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int maxn=(int)4e5+5; |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int maxn=(int)4e5+5; |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int maxn=105; |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int maxn=(int)4e5+5; |
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
import sys | |
readints=lambda:map(int, input().strip('\n').split()) | |
# use python due to biginteger issues | |
def maxprod(arr): | |
maxarr=arr[0] | |
minarr=arr[0] | |
haszero = arr[0]==0 |
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; | |
typedef long long ll; | |
template<typename T> | |
void out(T x) { cout << x << endl; exit(0); } | |
const int inf = 1e9; | |
const int maxn=(int)4e5+5; |
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; | |
namespace my { | |
template<class T, class F = less<T>> | |
struct priority_queue { | |
vector<T> v = {0}; | |
T i=0; // index if last elem | |
F cmp = F(); | |
priority_queue() {} |
NewerOlder