Skip to content

Instantly share code, notes, and snippets.

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

snuke snuke

🤷‍♀️
View GitHub Profile
#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 / 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) {
@snuke
snuke / _readme.md
Last active August 29, 2015 14:03
モールス信号暗記ゲーム

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

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

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

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

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

@snuke
snuke / _solution.cpp
Created June 25, 2014 10:11
ICPC2014 WF Problem A
//
// includes and macros
//
#define rep(i,n) for(int i = 0; i < n; i++)
int main(){
int n;
cin >> n;
//printf("%d\n",n);
if(n%4 == 0){
@snuke
snuke / 1 mod_inverse.cpp
Last active August 29, 2015 14:01
逆元
#include<iostream>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
int ex(int x, int t) {
if (t == 0) return 1;
ll res = ex(x, t >> 1);
(res *= res) %= mod;
@snuke
snuke / 2048.cpp
Last active August 29, 2015 14:00
2048AI
#include<cstdio>
#include<algorithm>
#include<vector>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < n; i++)
#define drep(i,n) for(int i = n-1; i >= 0; i--)
#define rng(a) a.begin(),a.end()
#define pb push_back
#define sz(x) (int)(x).size()
int main(){
int a = 1, b = 1;
for( ; a < 1000000; a += b, b = a-b){
printf("%d\n",a);
}
return 0;
}
@snuke
snuke / I.cpp
Created April 21, 2013 14:07
Japan Alumni Group Spring Contest 2013
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < n; i++)
#define maxs(x,y) x = max(x,y);
#define mins(x,y) x = min(x,y);
#define pb push_back
using namespace std;
@snuke
snuke / report.cpp
Created February 15, 2013 14:12
joi report
#include<cstdio>
#include<algorithm>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < n; i++)
#define rrep(i,n) for(int i = 1; i <= n; i++)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;