Skip to content

Instantly share code, notes, and snippets.

View snuke's full-sized avatar
🤷‍♀️

snuke snuke

🤷‍♀️
View GitHub Profile
@snuke
snuke / _readme.md
Last active August 29, 2015 14:03
モールス信号暗記ゲーム

-- --- .-. ... . -.-. --- -.. . --. .- -- .

なぜかモールス信号を覚えようと思って作ったゲームです。

なぜC++で作ったのか謎ですが、morse.cppを適当にコンパイルすると良いです。

1行目にMAX_LENという定数がありますが、これはtrainingモードで出てくるモールス信号の長さの制限です。

最初はこれを2にして始めて、覚えたら3にして、覚えたら4にして・・・とやると覚えやすいです。

@snuke
snuke / a.cpp
Created November 1, 2014 16:56
coderunner 2014 予選A
//インクルード・マクロ・定数 略
#define act(...) act2(__VA_ARGS__,"")
string token = "KONOTOKENHANISEMONODESU114514810";
string act2(string com, ...) {
string url = "https://game.coderunner.jp/";
url += com+"?token="+token;
va_list args;
va_start(args, com);
while (1) {
#include <iostream>
#include <algorithm>
#include <numeric>
using namespace std;
const int MAX_N = 605;
const int MAX_M = 180305;
const int INF = 1000;
int X[MAX_N];
#include <iostream>
#include <algorithm>
#include <numeric>
using namespace std;
const int MAX_N = 605;
const int MAX_M = 180305;
const int INF = 1000;
int X[MAX_N];
@snuke
snuke / ICPC_WF2015_K_hash.cpp
Last active November 23, 2015 16:40
Linear solution of ICPC WF 2015 K problem
// 乱数依存+map使用の軽実装バージョン
#include <cstdio>
#include <vector>
#include <map>
#include <cstdlib>
#define rep(i,n) for (int i = 0; i < n; ++i)
using namespace std;
typedef long long ll;
class ToursDecomposition {
@snuke
snuke / a.cpp
Created December 10, 2015 06:21
ICPC Singapore 2015
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define df(x) int x = in()
#define fi first
@snuke
snuke / HL.cpp
Created May 24, 2016 15:12
Heavy-Light Decomposition
// HL-decomposition
struct hl {
int n;
vector<vi> to, d;
vi vd, vk, pv, dep;
vector<bit> t; // bit
int root;
hl() {}
hl(int mx):n(mx),to(mx),vd(mx),vk(mx),dep(mx) {}
void add(int a, int b) {
@snuke
snuke / next_prime.cpp
Last active August 21, 2016 17:52
与えられた数以上の素数を小さい順に出力します。コマンドライン引数の1つ目は下限、2つ目は個数です。エイリアスを通しとくと地味に便利です。
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <ctime>
#include <cstdlib>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < n; i++)
@snuke
snuke / Running.txt
Last active May 16, 2021 21:19
team introduction
Hello, I am Kento Nikaido (aka. snuke) from the team Running.
I'd like to set you a puzzle.
I think of some English words and I tell you the FORMAT of the words.
Can you guess these words?
Example:
Q. ABCCDCE -> A. running
(Some words may be in the past tense or the -ing form.)
Problem:
@snuke
snuke / grundy.txt
Created November 16, 2016 06:27
2山nimのgrundy数
xの山とyの山のgrundy数を(x,y)に書いた表を考える。
1*1の表:
|0|
0-indexedなので、両方0の山です。
2*2の表:
|01|
|10|
このパターンが基本になってきます。