This file contains 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
57 34 26 | |
5 47 66 | |
35 27 1 | |
31 27 48 | |
26 25 24 | |
29 24 100 | |
28 29 41 | |
55 1 3 | |
32 16 25 | |
34 20 20 |
This file contains 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
6 5 3 | |
1 2 10 | |
2 3 91 | |
3 1 12 | |
4 5 18 | |
5 6 57 |
This file contains 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.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.InputStreamReader; | |
public class InputCheckerA { | |
public static void main(String[] args) throws Exception { | |
File inputDir = new File("/path/to/the/input/files/directory"); | |
for (File file : inputDir.listFiles()) { | |
BufferedReader reader = new BufferedReader(new FileReader(file)); |
This file contains 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.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.InputStreamReader; | |
public class InputCheckerI { | |
public static void main(String[] args) throws Exception { | |
String[] substasks = new String[]{"small", "large1", "large3"}; | |
for (String substask : substasks) { | |
File inputDir = new File("/path/to/the/input/directory/" + substask); |
This file contains 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.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileReader; | |
import java.io.InputStreamReader; | |
public class InputCheckerE { | |
public static void main(String[] args) throws Exception { | |
String[] substasks = new String[]{"nonloop", "loop"}; | |
for (String substask : substasks) { | |
File inputDir = new File("/path/to/the/input/data/" + substask); |
This file contains 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.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.Arrays; | |
public class FixTheFence { | |
boolean _debug = false; | |
long _xtime = 10000; | |
long _start_time = -1; |
This file contains 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.io.IOException; | |
import java.io.PrintWriter; | |
import java.util.Arrays; | |
import java.util.HashSet; | |
import java.util.Scanner; | |
import java.util.Set; | |
public class Main { | |
static final long MOD = 1000000007; |
This file contains 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
bool DEBUG = false; | |
double TLE = 30.0; | |
long _xtime = 30000; | |
int _maxTurn = 10000; | |
bool _debug = false; | |
#include <vector> | |
#include <list> | |
#include <map> |
This file contains 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 qualified Data.Map as Map | |
type Memo = Map.Map (Int,Int) Int | |
combination :: Memo -> Int -> Int -> (Int, Memo) | |
combination memo n r | |
| r == 0 = (1, memo) | |
| n == r = (1, memo) | |
| otherwise = | |
case Map.lookup (n,r) memo of |
This file contains 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
# Tree+Heap=Treap | |
class Treap | |
attr_accessor :value, :left, :right, :priority | |
# 空の頂点 | |
def self.empty() | |
obj = self.new | |
obj.value = -1 | |
obj.priority = rand(0.0...1.0) | |
obj |