Playrix Codescapes Cup (Codeforces Round #413, rated, Div. 1 + Div. 2), problem: (G) Cut the pie Solution In JAVA

By | 2017-07-24T13:31:05+00:00 July 24th, 2017|Categories: Java, Programming|Tags: , , , , , , |

import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream [...]

Codeforces Round #412 (rated, Div. 1, based on VK Cup 2017 Round 3), problem: (E) Blog Post Rating Solution In JAVA

By | 2017-07-24T02:42:50+00:00 July 24th, 2017|Categories: Java, Programming|Tags: , , , , , , |

import static java.lang.Double.parseDouble; import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.lang.Math.min; import static java.lang.System.exit; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Random; import java.util.StringTokenizer; public class E { static BufferedReader in; static PrintWriter out; static StringTokenizer tok; static int [...]

Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3), problem: (F) Perishable Roads Solution In JAVA

By | 2017-07-24T02:40:45+00:00 July 24th, 2017|Categories: Java, Programming|Tags: , , , , , , , , , , |

import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class Div2_412F { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); PrintWriter printer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int numV = Integer.parseInt(reader.readLine()); long[][] [...]

Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2), problem: (E) Vulnerable Kerbals Solution in JAVA

By | 2017-07-24T01:31:20+00:00 July 24th, 2017|Categories: Java, Programming|Tags: , , , , , , |

import java.util.ArrayList; import java.util.Scanner; /* 4 10 2 4 6 8 4 10 2 9 1 0 */ public class e { static ArrayList<Integer>[] gcdLists; public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(),m=in.nextInt(); boolean[] forbid = new [...]