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> | |
using namespace std; | |
int n, x; | |
long long sum; | |
int main() { | |
while(cin >> n, n) { | |
sum = 0; | |
priority_queue<long long> 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 <set> | |
using namespace std; | |
int n, x, k; | |
long long sum; | |
multiset<int> bills; | |
int main() { | |
while(cin >> n, n) { | |
sum = 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 <iostream> | |
#include <vector> | |
using namespace std; | |
#define n_unique 200005 | |
class SegmentTree { | |
private: | |
int n; | |
// A is the input array, st is the segment tree | |
vector<int> A, 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 <vector> | |
#include <map> | |
#include <algorithm> | |
using namespace std; | |
#define maxn (int)(1e5)+1 | |
int n; | |
map<vector<int>, int> m; | |
int main() { |
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 <map> | |
#include <string> | |
using namespace std; | |
map<string, string> p; | |
map<string, int> r, sizes; | |
inline string getSet(const string &s) { | |
if(p.find(s) == p.end()) { | |
p[s] = 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 <map> | |
#include <algorithm> | |
using namespace std; | |
#define maxn (int)(1e9)+1 | |
int t, n, x, ans, cnt, block; | |
map<int, int> lastseen; | |
int main() { |
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 <cstdio> | |
#include <vector> | |
using namespace std; | |
typedef pair<int, int> pii; | |
int n, g[3][3], gg[3][3]; | |
int main() { | |
//ios_base::sync_with_stdio(false); |
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 <set> | |
using namespace std; | |
#define ll long long | |
ll n, m, x, ans; | |
set<ll> cds; | |
int main() { | |
while(cin >> n >> m, n||m) { |
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 <bitset> | |
using namespace std; | |
#define maxn 1000001 | |
int n, m, s, t, r; | |
bitset<maxn> sch; | |
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 <cstdio> | |
using namespace std; | |
typedef long long ll; | |
ll a, b, n, i; | |
bool e; | |
int main() { | |
while(scanf("%lld", &n), n) { |