Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
poyo

prime number primenumber

:octocat:
poyo
View GitHub Profile
View Hanoi4.bf
>>>>++++>+>+>+++<<<
[
>[
<-[
[>>>>+>>>>+>>>>+<<<<<<<<<<<<-]
>[>>>>+>>>>+>>>>+<<<<<<<<<<<<-]
>[>>>>+>>>>+>>>>+<<<<<<<<<<<<-]
>[>>>>+>>>>+>>>>+<<<<<<<<<<<<-]
<++++++>>+>->>>>>>>
[<<<<<<<<<<<<+>>>>>>>>>>>>-]
View pgbattle_2020_katsuobushi_D.cpp
#include <bits/stdc++.h>
#include <variant>
#include <atcoder/all>
#define FOR(i,k,n) for(ll i=(k);i<(ll)(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) begin(x),end(x)
using namespace std;
using namespace std::string_literals;
using namespace atcoder;
View emile_othello.txt
12345678
8|________
7|________
6|________
5|___o*___
4|___*o___
3|________
2|________
1|________
12345678| black:2, white:2
View keybase.md

Keybase proof

I hereby claim:

  • I am primenumber on github.
  • I am primenumber (https://keybase.io/primenumber) on keybase.
  • I have a public key whose fingerprint is 3E1F C759 158C C59C 94B5 6293 9E6F 6717 E092 576B

To claim this, I am signing this object:

View even_odd.py
def relu(x):
return max(x, 0)
def linear1(x, n):
return [x, 2.0 * x - 2 ** n]
def linear2(x):
return x[0] + -1.0 * x[1]
def block(x, n):
@primenumber
primenumber / othello_solver.cu
Last active Aug 13, 2019
CUDA Othello Solver
View othello_solver.cu
// CUDA Othello Solver
// License: GPL 3
#include <cstdio>
#include <cassert>
constexpr int threadsPerBlock = 128;
constexpr int simdWidth = 4;
constexpr int nodesPerBlock = threadsPerBlock/simdWidth;
constexpr int MAX_DEPTH = 10;
@primenumber
primenumber / bsr.cpp
Last active Mar 25, 2018
Parallel bit scan reverse
View bsr.cpp
// author: prime (prime@kmc.gr.jp)
// License: MIT License
#include <iostream>
#include <vector>
#include <bitset>
#include <x86intrin.h>
#include <boost/timer/timer.hpp>
inline __m256i bsr_256_8_naive(__m256i x);
inline __m256i bsr_256_8_cvtfloat(__m256i x);
View unpack.cpp
#include <iostream>
#include <x86intrin.h>
#include <boost/timer/timer.hpp>
inline __m128i mm_delta_swap_epi64(__m128i a, __m128i mask, int delta) {
__m128i x = _mm_and_si128(_mm_xor_si128(a, _mm_srli_epi64(a, delta)), mask);
return _mm_xor_si128(_mm_xor_si128(a, x), _mm_slli_epi64(x, delta));
}
inline __m128i mm_unpacklo_epb_unpack_dswap(__m128i a, __m128i b) {
@primenumber
primenumber / quine.bf
Created Nov 28, 2016
Brainf*ckでQuine
View quine.bf
>>>>>>+++++>+++>++++++>+++>+>+>+>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+>+>+++>++++>++++++>++>++++>+++++++>+++++++>+++++++>+++++++>+++++++>+++>+++>+>+>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+++>++++>++++++>++>+>++>++>+++++>+++>+++++++>++>+++++>+++>+++>+++++++>+++>+>++>++>++>++++>++++++>+++>+++++>++>+>+++>++++>++++++>+++>+++++>++>+>+++>++++>++++++>++>++>++>++++++>+++>+++>+++>+++>+++++>+++>++++++>++>+++++>+++>+>++>++++>+++++>++++>+++++>++++>+++++>++++>+++++>++++>+++++>++++>+++++>+++>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+>+>+++>++++>++++++>++>+++++++>+++++>++++>++++++>++++++>+++>+++++>+>+>+>+>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+>+>+>+++>++++>++++++>++>+>+>+>+++++++>+++++>++++>++++++>+++>++++++>++>++++++>+++>+++++>+>+>+>+>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+>+>+>+++>++++>++++++>++>+>+++++++>+++++>++++>++++++>+++>++++++>++>++++++>+++>+++++>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+>+>+++>++++>++++++>++>+++++++>+++++>++++>++++++>+++>++++++>++>++++++>+++>+++++>+>+>+>+>+>+++++>++>+>+>+>+>+>+>+>+>+>+>+++>++++>++++++>++>+++++++>+++++>++++>++++++>+++>++++++>
@primenumber
primenumber / a.cpp
Last active Dec 3, 2015
高速文字列処理ライブラリ「A」
View a.cpp
#include "a.hpp"
#include <cmath>
A::size_type find(const A &lhs, const A &rhs) {
if (lhs.n >= rhs.n) return 0;
else return A::npos;
}
A replace(const A &dest, const A &pattern, const A &rep) {
A::size_type count = dest.n / pattern.n;