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.util.*; | |
import static java.lang.Math.*; | |
public class Guide { | |
public static void main(String... args) { | |
new Guide().run(); | |
} | |
public void run() { | |
Scanner sc = new Scanner(System.in); |
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.util.*; | |
import static java.lang.Math.*; | |
import static java.util.Arrays.*; | |
public class Alien { | |
public static void main(String... args) throws Exception { | |
new Alien().run(); | |
} |
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.util.*; | |
import java.io.*; | |
public class Main implements Runnable { | |
private final int N, B; | |
private final int[] next; | |
public Main(final int n, final int b, final int[] nx) { | |
N = n; | |
B = b; |
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.util.*; | |
public class Main implements Runnable { | |
private static final long MOD = 1000000009; | |
private static final int MAX = 62; | |
@Override | |
public void run() { | |
Scanner sc = new Scanner(System.in); |
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.util.*; | |
import java.math.*; | |
public class Main implements Runnable { | |
private static final long MOD = 1000000007; | |
private static final BigInteger BMOD = BigInteger.valueOf(MOD); | |
private static long inv(final long l) { | |
return BigInteger.valueOf(l).modInverse(BMOD).longValue(); | |
} |
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.util.*; | |
public class Main implements Runnable { | |
private final V[] bases; | |
private final int n, k; | |
private Main(V[] bases, int n, int k) { | |
this.bases = bases; | |
this.n = n; |
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.util.*; | |
public class Main implements Runnable { | |
private final V s; | |
private final int k; | |
private Main(V s, int k) { | |
this.s = s; | |
this.k = k; |
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.util.*; | |
import static java.lang.Math.min; | |
public class Main { | |
private final int N; | |
private final int[] L; | |
private final int[] R; |
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.util.*; | |
public class Main { | |
public static void main(String...args) { | |
Scanner sc = new Scanner(System.in); | |
int q = sc.nextInt(); | |
long d = 0; | |
for (int i = 0; i < q; i++) { | |
sc.next(); | |
if (sc.next().charAt(0) == '(') | |
d += sc.nextInt(); |
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.*; | |
import java.util.*; | |
public class Main { | |
static final int L = 50; | |
public void run() { | |
Scanner sc = new Scanner(System.in); | |
while (sc.hasNext()) { |