Skip to content

Instantly share code, notes, and snippets.

View algon-320's full-sized avatar
😎

Jun Ishiguro algon-320

😎
  • Google
  • Tokyo, Japan
  • 05:48 (UTC +09:00)
View GitHub Profile
@algon-320
algon-320 / BearNSWE.cpp
Last active July 29, 2016 13:02
SRM 695 easy
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);i++)
#define FORE(x,arr) for(auto &x:arr)
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
@algon-320
algon-320 / ECR15A.cpp
Last active July 30, 2016 11:05
Educational Codeforces Round #15
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);i++)
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
@algon-320
algon-320 / UpDownNess.cpp
Created August 4, 2016 15:10
SRM 694 Div2 Hard.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
#define ITR(i,c) for(auto i=begin(c);i!=end(c);i++)
#define FORE(x,arr) for(auto &x:arr)
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
@algon-320
algon-320 / auto_get_rating.html
Last active June 9, 2021 13:39
AtCoder・Codeforces・TopCoderのレーティングを取得して色付きで表示する
<p>
AtCoder : <a id="atcoder" target="_blank" style="text-decoration:none;font-weight:bold;">loading</a><br>
Codeforces : <a id="codeforces" target="_blank" style="text-decoration:none;font-weight:bold;">loading</a><br>
TopCoder SRM : <a id="topcoder" target="_blank" style="text-decoration:none;font-weight:bold;">loading</a><br>
</p>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.1.1.min.js"></script>
<script type="text/javascript">
var ratings = { 'atcoder':0, 'codeforces':0, 'topcoder':0 };
var handles = { 'atcoder':'algon', 'codeforces':'algon_320', 'topcoder':'algon_320' };
@algon-320
algon-320 / competitive_programming_color.json
Last active May 11, 2020 00:27
AtCoder, Codeforces, TopCoderのレーティングと対応する色コード
{
"atcoder": [
{ "color": "#808080", "min": 0, "max": 399 },
{ "color": "#804000", "min": 400, "max": 799 },
{ "color": "#008000", "min": 800, "max": 1199 },
{ "color": "#00C0C0", "min": 1200, "max": 1599 },
{ "color": "#0000FF", "min": 1600, "max": 1999 },
{ "color": "#C0C000", "min": 2000, "max": 2399 },
{ "color": "#FF8000", "min": 2400, "max": 2799 },
{ "color": "#FF0000", "min": 2800, "max": 9999 }
#include <bits/stdc++.h>
using namespace std;
#define int long long
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)
@algon-320
algon-320 / gen_wav.c
Last active November 20, 2017 20:41
wavファイルを書き出す
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdint.h>
struct wave_header {
unsigned char riff[4]; // "RIFF"
unsigned int fsize; // ファイルサイズ - 8
unsigned char type[4]; // "WAVE"
@algon-320
algon-320 / wave.cpp
Last active May 8, 2017 13:56
WAVファイルを書き出す (c++版)
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
// 44100 Hz / 16 bit / ステレオ のリニアPCM
#define SAMPLING_RATE (44100)
@algon-320
algon-320 / fizzfuzz.tex
Created May 9, 2017 14:13
TeXでFizzBuzz
\documentclass{jarticle}
\makeatletter
\newcount \xx@res
\def\remainder#1#2{
\newcount \xx@a
\xx@a = #1
\divide \xx@a #2
\multiply \xx@a -#2
\advance \xx@a #1
\xx@res = \xx@a
#include <bits/stdc++.h>
using namespace std;
string reverseChallenge(string s) {
string t, ans;
vector<int> len;
int l = 0;
s += ' ';
for(size_t i = 0; i < s.size(); i++) {
if(s[i]==' ') {