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 <iostream> | |
using namespace std; | |
typedef long long ll; | |
ll size, p, x, y; | |
int main() { | |
ios_base::sync_with_stdio(false); | |
cin.tie(NULL); |
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 <iostream> | |
typedef long long ll; | |
using namespace std; | |
ll size, p, x, y; | |
int main() { | |
ios_base::sync_with_stdio(false); | |
cin.tie(NULL); |
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 <iostream> | |
#include <vector> | |
#include <set> | |
using namespace std; | |
int t, b, ng, nb; | |
multiset<int> green, blue; | |
int main() { | |
cin >> t; | |
for(int tt=0; tt<t; tt++) { |
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 <iostream> | |
#include <vector> | |
#include <string> | |
#include <sstream> | |
using namespace std; | |
vector<int> p, r; | |
inline void init(int n) { | |
p.resize(n); | |
r.resize(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 <iostream> | |
#include <vector> | |
#include <map> | |
#include <utility> | |
using namespace std; | |
/* begin UFDS implementation */ | |
int nSets; | |
map<char, char> p; | |
map<char, int> r, sizes; |
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 <iostream> | |
#include <vector> | |
#include <string> | |
using namespace std; | |
class SegmentTree { | |
private: | |
int n; | |
vector<char> st; |
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 <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
class FenwickTree { | |
private: | |
vector<int> ft; | |
int LSO(int b) { return (b&(-b)); } | |
public: |
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 <iostream> | |
#include <queue> | |
#include <string> | |
#include <utility> | |
using namespace std; | |
#define mp make_pair | |
int qn, p, k; | |
string s; |
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 <iostream> | |
#include <queue> | |
#include <stack> | |
using namespace std; | |
int main() { | |
int n, c, x; | |
while(cin >> n) { | |
bool bq = true, bs = true, bpq = true; | |
queue<int> q; |
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 <iostream> | |
#include <vector> | |
using namespace std; | |
#define maxn (int)(1e6)+1 | |
vector< vector<int> > a(maxn); | |
int n, m, k, v; | |
int main() { | |
while(cin >> n >> m) { |