Skip to content

Instantly share code, notes, and snippets.

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

snuke snuke

🤷‍♀️
View GitHub Profile
@snuke
snuke / c++
Created February 15, 2012 08:26
HAL2011
/**
* @file
* @brief 参加者が解答を記述するファイル。
*/
#include "HPCIncludes.hpp"
//#include "cstdio"
//----------------------------------------------------------
using namespace hpc; // 名前空間が不必要な場合はこのように記述。
@snuke
snuke / $scores
Created February 23, 2012 07:59
simroad by snuke
1: 126
2: 37
3: 349
4: 883
5: 615
/*******************************************************************
SuperCon12: Template for input output procedures
file: sc12_template2E.cu
by S.Kishimoto and O.Watanabe Aug. 17, 2012
ver.2 by T.Endo and A.Nukada Aug. 22, 2012
Remark: @@@ for test/tentative statements
*********************************************************************/
/********* Template Part (1) NO CHAGNGE FROM HERE **********/
@snuke
snuke / readme
Last active December 12, 2015 03:09
lowlinkを再帰関数を使わずに求めるのはどうするのがいいだろうかと考えてみた。
lowlink.cpp:再帰関数を使った普通のlowlink
lowlink1.cpp:再帰関数を使わないlowlink
lowlink2.cpp:再帰関数を使わないlowlinkその2
/////////////////// lowlink ///////////////////
こんな感じに囲んであるのがlowlinkを求める部分。
///////////////////////////////////////////////
@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;
@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;
int main(){
int a = 1, b = 1;
for( ; a < 1000000; a += b, b = a-b){
printf("%d\n",a);
}
return 0;
}
@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()
@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 / _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){