Skip to content

Instantly share code, notes, and snippets.

View algon-320's full-sized avatar
😎

Jun Ishiguro algon-320

😎
  • Google
  • Tokyo, Japan
  • 01:41 (UTC +09:00)
View GitHub Profile
@algon-320
algon-320 / srm717div2hard.cpp
Last active July 1, 2017 01:29
DerangementsDiv2
#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) {
#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;
#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++) {
@algon-320
algon-320 / srm718div2easy.cpp
Last active July 13, 2017 18:52
SRM 718 Div2 my submissions
#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)
@algon-320
algon-320 / get_submission_from_codeforces.py
Created July 26, 2017 05:39
codeforcesのACの提出コードをローカルに保存する
#!/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
#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) {
#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) {
// 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;
// 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;
#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)