Skip to content

Instantly share code, notes, and snippets.

@na-o-ys
na-o-ys / gist:902899311a3983aeac56
Created March 17, 2015 00:38
SRM 652 Div1 Easy
#include <bits/stdc++.h>
#define loop(n, i) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
class ThePermutationGame
@na-o-ys
na-o-ys / b2.cpp
Last active August 29, 2015 14:14
Rockethon 2015
#include <bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
int main()
{
int n;
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
int main_calc(int n, int m, stack<int> **tray);
int main(int argc, char const* argv[])
{
@na-o-ys
na-o-ys / rsa.rb
Last active August 29, 2015 14:10
handcrafted rsa
require './rsa_math.rb'
class RSA
class << self
PUBLIC_EXPONENT = 65537
def gen_key(bits)
e = PUBLIC_EXPONENT
p = RSAMath.gen_prime(bits/2)
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#define loop(n, i) for(int i=0;i<n;i++)
#define from_to(from, to, i) for(int i=from;i<=to;i++)
using namespace std;
a1,X,90,0,start
a2,X,90,180
a3,I,270,90
a4,I,180,180
a5,X,180,0
a6,X,180,90
a7,X,270,180
a8,T,90,90
a9,T,90,0
a10,X,180,0
package main
import (
"fmt"
"math"
)
type Vertex struct {
X, Y float64
}