Skip to content

Instantly share code, notes, and snippets.

View orisano's full-sized avatar

Nao Yonashiro orisano

View GitHub Profile
@orisano
orisano / pck2012_1.c
Created November 11, 2012 13:30
PCK本戦1問目:後になって書いてみた編
#include <stdio.h>
enum {A, X, Y, Z, W, B, ERROR};
int map[6][2] = {
{X, Y},
{ERROR, Z},
{X, ERROR},
{W, B},
{B, Y},
{Y, X}
@orisano
orisano / pck2012_2.c
Created November 11, 2012 13:48
PCK本戦2問目:後になって書いてみた編
#include <stdio.h>
#define LIMIT (10000)
int main(void)
{
int n;
int mem[2][10000];
int ct;
int under_line;
@orisano
orisano / pck2012_1.c
Created November 11, 2012 15:38
PCK本戦:後になって書いてみた編
#include <stdio.h>
enum {A, X, Y, Z, W, B, ERROR};
int map[6][2] = {
{X, Y},
{ERROR, Z},
{X, ERROR},
{W, B},
{B, Y},
{Y, X}
@orisano
orisano / opencv_link.h
Created May 8, 2013 16:52
OpenCVのリンクを楽にするためのヘッダファイル
#include <stdio.h>
#define N (1 << 19)
typedef long long int int64;
int64 seg[N << 1] = { 0 };
static inline int64 sum(int a, int b, int x, int l, int r)
{
#include <stdio.h>
#define CODE_IQ
typedef struct{long _[__GNUC__];}____;int _____=__LINE__,_______;
main(int _,char**__,char**___)
{
char *______=__VERSION__;
while(*___[_______]-*______-sizeof(double)*sizeof(float)+sizeof(char))++_______;
___[_______][__FUNCTION__[_____]-__func__[--_____]]=!_____;___[_______][_]+=sizeof(____);
for(_____=!!NULL;___[_______][++_____];)___[_______][_____]^=__LDBL_MANT_DIG__/__FLT_RADIX__;
return putchar((_____<<=_____)-(**__=((_<<_<<_<<_)-_))*(__CHAR_BIT__-__llvm__)+!printf(++___[_______],_)),______+=putchar(__builtin_popcount(__INT_MAX__)+_++),!puts((char[]){_____>>~-_|**__, *__FUNCTION__+__USER_LABEL_PREFIX__,__FLT_MAX_EXP__-~-__DBL_DIG__,______[-_],EOF[______], !__APPLE__});
/*************************************************************************
参考資料
http://ja.wikipedia.org/wiki/%E3%83%AD%E3%83%BC%E3%83%9E%E6%95%B0%E5%AD%97
**************************************************************************/
#include <assert.h>
#include <stdio.h>
#include <string.h>
int arabic_to_roman(int arabic, char *roman);
int check(int arabic, const char *roman);
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef tuple<int, int> duo;
const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
const int Mod = 1000000000 + 0;
#coding:utf-8
import random
def is_prime(n):
i = 2
while i * i <= n:
if n % i == 0:
return False
i += 1
@orisano
orisano / 2015-yo-t1.cc
Created December 14, 2014 09:19
JOI2015予選
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef tuple<int, int> duo;
const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
const int Mod = 1000000000 + 0;