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; | |
static const int MOD = 1000000007; | |
struct DerangementsDiv2 { | |
long long bin_pow_mod(long long x,long long y) { | |
if(x==0) return 0; | |
long long prod=1; | |
while(y>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; | |
struct NiceTable { | |
string isNice(vector<string> t) { | |
int n=t.size(); | |
int m=t[0].size(); | |
for(int x=0; x<(1<<n); x++) { | |
for(int y=0; y<(1<<m); y++) { | |
bool ok=true; |
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; | |
struct LexmaxReplace { | |
string get(string s, string t) { | |
sort(begin(t), end(t)); | |
reverse(begin(t), end(t)); | |
int n=s.size(); | |
int idx=0; | |
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> | |
using namespace std; | |
using ll=long long; | |
using vi=vector<int>; | |
using vl=vector<long long>; | |
using pii=pair<int,int>; | |
using pll=pair<long long,long long>; | |
#define ITR(i,c) for(auto i=begin(c);i!=end(c);++i) | |
#define FORE(x,c) for(auto &x:c) | |
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++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
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
import sys | |
import urllib2 | |
import lxml.html | |
import re | |
handle = "" # your codeforces handle | |
my_submissions_url = 'http://codeforces.com/submissions/' + handle |
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 size; | |
vector<long long> val; | |
vector<long long> lazy; | |
vector<int> width; | |
void lazy_propagate(int p) { | |
if (lazy[p] > 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; | |
const long long INF = 1001001001001001001ll; | |
int size; | |
vector<long long> val; | |
vector<long long> lazy; | |
void lazy_propagate(int p) { |
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
// http://codeforces.com/contest/242/submission/29553728 | |
#include <bits/stdc++.h> | |
using namespace std; | |
struct segtree { | |
int size; | |
vector<int> val; | |
vector<bool> lazy; | |
vector<int> width; |
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
// http://code-festival-2015-final-open.contest.atcoder.jp/submissions/1519172 | |
#include <bits/stdc++.h> | |
using namespace std; | |
struct starry_sky_tree { | |
int size; | |
vector<int> data; | |
vector<int> lazy; | |
vector<int> width; |
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 int long long | |
using ll=long long; | |
using vi=vector<int>; | |
using pii=pair<int,int>; | |
#define ALL(c) begin(c),end(c) | |
#define RALL(c) rbegin(c),rend(c) | |
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i) | |
#define FORE(x,c) for(auto &x:c) |