Skip to content

Instantly share code, notes, and snippets.

View Leko's full-sized avatar
🏠
Working from home

Shingo Inoue Leko

🏠
Working from home
View GitHub Profile
@Leko
Leko / testGist.js
Created October 1, 2012 07:44
tset js
function Main(inp) {
inp = inp.split("\n");
i = inp[0];
if ( i%4==0 && i%100!=0 || i%400==0 ) console.log("YES");
else console.log("NO");
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
@Leko
Leko / gist:4319165
Created December 17, 2012 15:35
CodeIQというサイトのコードゴルフで17位だったコードです。 妥協が速すぎた。次はもっと粘りたい。
r="";for(y=-1;++y<40;r+="\n")for(x=0;x<80;a=40-x++,b=40-y*2,r+=a*a+b*b<900?"*":"-");return r;
@Leko
Leko / alfred_aoj.php
Created May 19, 2013 15:55
aojのカテゴリ検索+回答状態の確認をAlfred上で可能にします。 ********************になっている部分を自分のAOJのidにして使って下さい。 表示された問題を選択すると、該当する問題が日本語で開かれます。
<?php
require_once('workflows.php');
$wf = new Workflows();
/*
利用可能なカテゴリ一覧
datamanipu データ操作
string 文字列
probability 確率
geometry 幾何
@Leko
Leko / AOJ_0023.cpp
Last active December 18, 2015 05:48
AOJ 0023 Circles Intersection Time Limit : 1 sec, Memory Limit : 65536 KB
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#define TIMES(i) while(i--)
#define REP(i, n) for ( int i = 0; i < n; i++ )
using namespace std;
@Leko
Leko / AOJ_1144.cpp
Last active December 18, 2015 05:48
AOJ 1144 Curling 2.0 Time Limit : 1 sec, Memory Limit : 65536 KB
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#define REP(i, n) for ( int i = 0; i < n; i++ )
using namespace std;
@Leko
Leko / AOJ_0179.cpp
Last active December 18, 2015 05:48
AOJ 0179 Mysterious Worm Time Limit : 5 sec, Memory Limit : 65536 KB
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
using namespace std;
typedef pair<string, int> bug;
typedef map<string, int> closeMap;
@Leko
Leko / AOJ_1130_bfs.cpp
Last active December 18, 2015 05:48
AOJ 1130 Red and Black Time Limit : 1 sec, Memory Limit : 65536 KB
// 横型探索
#include <iostream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
int w, h;
int mx[] = {0, 0, -1, 1};
@Leko
Leko / AOJ_1130_dfs.cpp
Last active December 18, 2015 05:48
AOJ 1130 Red and Black Time Limit : 1 sec, Memory Limit : 65536 KB
// 縦型探索
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int w, h;
int mx[] = {0, 0, -1, 1};
int my[] = {-1, 1, 0, 0};
@Leko
Leko / AOJ_1179.cpp
Last active December 18, 2015 05:48
AOJ 1179 Millennium Time Limit : 8 sec, Memory Limit : 65536 KB
#include <iostream>
#include <string>
#define REP(i, n) for ( int i = 0; i < n; i++ )
using namespace std;
int month[] = {0, 0, 20, 39, 59, 78, 98, 117, 137, 156, 176, 195, 215, 234 };
int year(int y) {
@Leko
Leko / AOJ_1180.cpp
Last active December 18, 2015 05:48
AOJ 1180 Recurring Decimals Time Limit : 8 sec, Memory Limit : 65536 KB
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#define REP(i, n) for ( int i = 0; i < n; i++ )
using namespace std;