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
package com.algorithims | |
import java.util.Arrays; | |
import java.util.Random; | |
import java.util.Scanner; | |
public class BinarySearch { | |
Random random; | |
Scanner input; | |
int[] num; |
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
source 'http://rubygems.org' | |
gem 'rails', '3.0.7' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'mysql2' | |
# Use unicorn as the web server |
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 <iostream> | |
using namespace std; | |
struct UnionFind { | |
int N, *id, *sz; | |
UnionFind(int _N) { | |
N = _N; | |
id = new int[_N]; | |
sz = new int[_N]; |
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 <iostream> | |
#include <vector> | |
#include <queue> | |
#include <algorithm> | |
#include <string.h> | |
#include <stdio.h> | |
#define MAXN 110 | |
#define INF 1000000000; |
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 <iostream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
#include <set> | |
#include <map> | |
#include <list> | |
#include <queue> | |
#include <stack> | |
#include <memory> |
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
import java.util.*; | |
import java.math.*; | |
public class DengklekTryingToSleep { | |
public int minDucks(int[] ducks) { | |
Arrays.sort(ducks); | |
Set<Integer> aux = new HashSet<Integer>(); | |
for(int i: ducks) aux.add(i); | |
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
import java.util.*; | |
import java.math.*; | |
public class DengklekMakingChains { | |
public int maxBeauty(String[] chains) { | |
int ans = 0, if_not_possible_ans = 0; | |
for(int i = 0; i < chains.length; i++) { | |
int tmp = 0; | |
for(int j = 0; j < 3; j++) if(chains[i].charAt(j) != '.') { |
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 <iostream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
#include <set> | |
#include <map> | |
#include <list> | |
#include <queue> | |
#include <stack> | |
#include <memory> |
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 <iostream> | |
#include <string> | |
#include <sstream> | |
#include <vector> | |
#include <set> | |
#include <map> | |
#include <list> | |
#include <queue> | |
#include <stack> | |
#include <memory> |
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
import sys | |
values = [1, 4, 9, 121, 484, 10201, 12321, 14641, 40804, 44944, 1002001, 1234321, 4008004, 100020001, 102030201, | |
104060401, 121242121, 123454321, 125686521, 400080004, 404090404, 10000200001, 10221412201, 12102420121, | |
12345654321, 40000800004, 1000002000001, 1002003002001, 1004006004001, 1020304030201, 1022325232201, | |
1024348434201, 1210024200121, 1212225222121, 1214428244121, 1232346432321, 1234567654321, 4000008000004, | |
4004009004004, 100000020000001, 100220141022001, 102012040210201, 102234363432201, 121000242000121, | |
121242363242121, 123212464212321, 123456787654321, 400000080000004, 10000000200000001, 10002000300020001, | |
10004000600040001, 10020210401202001, 10022212521222001, 10024214841242001, 10201020402010201, | |
10203040504030201, 10205060806050201, 10221432623412201, 10223454745432201, 12100002420000121, |
OlderNewer