This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Treap{ | |
typedef struct _Node { | |
int x,y,c; | |
_Node *l, *r; | |
_Node(int _x): x(_x), y(rand()), c(1), l(NULL), r(NULL) {} | |
~_Node() { delete l; delete r; } | |
void recalc() { c = 1 + (l?l->c:0) + (r?r->c:0); } | |
} *Node; | |
int count(Node v) { return v?v->c:0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env ruby | |
require 'rmagick' | |
if ARGV.length < 3 | |
puts "Usage: #{$0} input_file data output_file" | |
abort("ERROR: Wrong arguments") | |
end | |
input = ARGV[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
#include <bits/stdc++.h> | |
using namespace std; | |
// typedef | |
typedef long long ll; | |
typedef pair<int,int> ii; | |
typedef pair<double,double> dd; | |
typedef vector<int> vi; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A. Internet Bandwidth | |
* | |
* Problem max flow straight-forward, | |
* accepted dengan algoritma Edmond-Karp | |
*/ | |
#include <bits/stdc++.h> | |
using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var passport = require('passport'); | |
var CasStrategy = require('passport-cas2').Strategy; | |
var session = require('express-session'); | |
var app = express(); | |
var port = process.env.PORT || 3000; | |
app.use(session({secret: 'supersecretkey'})); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void drawArrow(Graphics g1, int x1, int y1, int x2, int y2) { | |
Graphics2D g = (Graphics2D) g1.create(); | |
double dx = x2 - x1, dy = y2 - y1; | |
double angle = Math.atan2(dy, dx); | |
int len = (int) Math.sqrt(dx*dx + dy*dy); | |
AffineTransform at = AffineTransform.getTranslateInstance(x1, y1); | |
at.concatenate(AffineTransform.getRotateInstance(angle)); | |
g.transform(at); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Reader { | |
static BufferedReader br; | |
static InputStreamReader isr; | |
static StringTokenizer tokenizer=new StringTokenizer(""); | |
static String buffer; | |
public Reader(){ | |
isr = new InputStreamReader(System.in); | |
br = new BufferedReader(isr); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
#include <vector> | |
#include <queue> | |
#include <cmath> | |
#include <iostream> | |
#include <ctime> | |
using namespace std; | |
const int width = 1366, | |
height = 768, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
// typedef | |
typedef long long ll; | |
typedef pair<int,int> ii; | |
typedef pair<double,double> dd; | |
typedef pair<int,ii> iii; | |
typedef pair<double,dd> ddd; | |
typedef vector<ll> vll; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
// typedef | |
typedef long long ll; | |
typedef pair<int,int> ii; | |
typedef pair<double,double> dd; | |
typedef vector<int> vi; | |
typedef vector<double> vd; | |
typedef vector<string> vs; |