src
stringlengths
95
64.6k
complexity
stringclasses
7 values
problem
stringclasses
256 values
from
stringclasses
1 value
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class A { BufferedReader in; StringTokenizer st; PrintWriter out; static class House implements Comparable<House> { final int x, a; House(int x, int a) { this.x = x; this.a = a; } public int compareTo(House h) { return x - h.x; } } void solve() throws IOException { int n = nextInt(); int t = nextInt(); House[] h = new House[n]; for (int i = 0; i < n; ++i) { h[i] = new House(2 * nextInt(), nextInt()); } Arrays.sort(h); int ans = 2; for (int i = 1; i < n; ++i) { House prev = h[i - 1]; House curr = h[i]; int diff = 2 * t + curr.a + prev.a; if (curr.x - prev.x == diff) { ++ans; } else if (curr.x - prev.x > diff) { ans += 2; } } out.println(ans); } public void run() throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); eat(""); solve(); out.close(); in.close(); } void eat(String s) { st = new StringTokenizer(s); } String next() throws IOException { while (!st.hasMoreTokens()) { String line = in.readLine(); if (line == null) { return null; } eat(line); } return st.nextToken(); } int nextInt() throws IOException { return Integer.parseInt(next()); } long nextLong() throws IOException { return Long.parseLong(next()); } double nextDouble() throws IOException { return Double.parseDouble(next()); } public static void main(String[] args) throws IOException { new A().run(); } }
nlogn
15_A. Cottage Village
CODEFORCES
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.fill; import static java.util.Arrays.binarySearch; import static java.util.Arrays.sort; public class Main { public static void main(String[] args) throws IOException { // try { // if (new File("input.txt").exists()) // System.setIn(new FileInputStream("input.txt")); // } catch (SecurityException e) {} // long time1 = System.currentTimeMillis(); new Main().run(); // checkMemory(); // long time2 = System.currentTimeMillis(); // System.err.println((time2 - time1) + " ms"); } BufferedReader in; PrintWriter out; StringTokenizer st = new StringTokenizer(""); int vNum; int eNum; boolean[][] g; void run() throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); vNum = nextInt(); eNum = nextInt(); g = new boolean [vNum][vNum]; for (int e = 0; e < eNum; e++) { int u = nextInt() - 1; int v = nextInt() - 1; g[u][v] = g[v][u] = true; } // for (int v = 7; v <= 11; v++) { // genFullGraph(v); // if (naiveDP() != optimizedDP()) // System.err.println("Error on " + v); // } out.println(optimizedDP()); out.close(); } /*************************************************************** * Test **************************************************************/ long naiveDP() { long[] count = new long [vNum + 1]; int size = 1 << vNum; long[][] dp = new long [size][vNum]; for (int begin = 0; begin < vNum; begin++) { for (long[] row : dp) fill(row, 0L); dp[1 << begin][begin] = 1L; for (int mask = 0; mask < size; mask++) { int len = Integer.bitCount(mask); for (int v = 0; v < vNum; v++) { long cval = dp[mask][v]; if (cval == 0L) continue; if (g[v][begin]) count[len] += cval; for (int nv = 0; nv < vNum; nv++) { if (g[v][nv]) { int nmask = mask | (1 << nv); if (nmask != mask) dp[nmask][nv] += cval; } } } } } long ret = 0L; for (int len = 3; len <= vNum; len++) { if (count[len] % (len * 2) != 0) System.err.println("ERROR!"); ret += count[len] / len / 2; } return ret; } long optimizedDP() { long[] count = new long [vNum + 1]; long[][] dp = new long [1 << vNum][vNum]; for (int last = vNum - 1; last >= 0; last--) { int size = 1 << last; for (int mask = 0; mask < size; mask++) fill(dp[mask], 0, last, 0L); for (int nv = 0; nv < last; nv++) if (g[last][nv]) dp[1 << nv][nv] = 1L; for (int mask = 0; mask < size; mask++) { int len = Integer.bitCount(mask) + 1; for (int v = 0; v < last; v++) { long cval = dp[mask][v]; if (cval == 0L) continue; if (g[v][last]) count[len] += cval; for (int nv = 0; nv < last; nv++) { if (g[v][nv]) { int nmask = mask | (1 << nv); if (nmask != mask) dp[nmask][nv] += cval; } } } } } long ret = 0L; for (int len = 3; len <= vNum; len++) { if (count[len] % 2 != 0) System.err.println("ERROR!"); ret += count[len] >> 1; } return ret; } void genFullGraph(int vNum) { this.vNum = vNum; this.eNum = vNum * (vNum - 1) / 2; g = new boolean [vNum][vNum]; for (int i = 0; i < vNum; i++) for (int j = i + 1; j < vNum; j++) g[i][j] = g[j][i] = true; } /*************************************************************** * Utility **************************************************************/ static long b2mb(long b) { return b >> 20; } static void checkMemory() { System.err.println(b2mb(Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) + "/" + b2mb(Runtime.getRuntime().totalMemory()) + " MB"); } /*************************************************************** * Input **************************************************************/ String nextToken() throws IOException { while (!st.hasMoreTokens()) st = new StringTokenizer(in.readLine()); return st.nextToken(); } int nextInt() throws IOException { return Integer.parseInt(nextToken()); } long nextLong() throws IOException { return Long.parseLong(nextToken()); } double nextDouble() throws IOException { return Double.parseDouble(nextToken()); } String nextLine() throws IOException { st = new StringTokenizer(""); return in.readLine(); } boolean EOF() throws IOException { while (!st.hasMoreTokens()) { String s = in.readLine(); if (s == null) return true; st = new StringTokenizer(s); } return false; } }
np
11_D. A Simple Task
CODEFORCES
import java.io.*; import java.util.*; public class Main { class IO { BufferedReader reader; PrintWriter writer; StringTokenizer tokenizer; IO() { reader = new BufferedReader(new InputStreamReader(System.in)); writer = new PrintWriter(new BufferedOutputStream(System.out)); tokenizer = new StringTokenizer(""); } IO(String file) throws FileNotFoundException { reader = new BufferedReader(new FileReader(file)); writer = new PrintWriter(new BufferedOutputStream(System.out)); tokenizer = new StringTokenizer(""); } String next() throws IOException { while (tokenizer == null || !tokenizer.hasMoreTokens()) { String line = reader.readLine(); if (line == null) return null; tokenizer = new StringTokenizer(line); } return tokenizer.nextToken(); } public Integer nextInt() throws IOException { return Integer.parseInt(next()); } public Long nextLong() throws IOException { return Long.parseLong(next()); } public Double nextDouble() throws IOException { return Double.parseDouble(next()); } public void write(Object obj) { writer.print(obj.toString()); } public void writeSpace(Object obj) { writer.print(obj.toString() + " "); } public void writeLine(Object obj) { writer.println(obj.toString()); } public void close() { writer.close(); } } IO io; Main() { io = new IO(); } Main(String file) throws FileNotFoundException { io = new IO(file); } void solve() throws IOException { long n = io.nextLong(), s = io.nextLong(); long min = s; while (true) { min++; long sum = 0, tem = min; while (tem > 0) { sum += tem % 10; tem /= 10; } if (min - sum >= s) break; } io.write(Math.max(0, n - min + 1)); } void close() { io.close(); } public static void main(String args[]) throws IOException { // Main solver = new Main("input.txt"); Main solver = new Main(); solver.solve(); solver.close(); } }
logn
817_C. Really Big Numbers
CODEFORCES
import java.io.*; import java.math.BigInteger; import java.util.StringTokenizer; public class C { public static void main(String[] args) throws IOException { init(System.in); BigInteger x = new BigInteger(next()); if (x.compareTo(BigInteger.ZERO) == 0) { System.out.println(0); return; } BigInteger k = new BigInteger(next()); BigInteger mod = new BigInteger("1000000007"); BigInteger two = BigInteger.ONE.add(BigInteger.ONE); BigInteger ans = two.modPow(k, mod); ans = ans.multiply(two.multiply(x).subtract(BigInteger.ONE)).add(BigInteger.ONE).mod(mod); System.out.println(ans); } //Input Reader private static BufferedReader reader; private static StringTokenizer tokenizer; private static void init(InputStream inputStream) { reader = new BufferedReader(new InputStreamReader(inputStream)); tokenizer = new StringTokenizer(""); } private static String next() throws IOException { String read; while (!tokenizer.hasMoreTokens()) { read = reader.readLine(); if (read == null || read.equals("")) return "-1"; tokenizer = new StringTokenizer(read); } return tokenizer.nextToken(); } // private static int nextInt() throws IOException { // return Integer.parseInt(next()); // } // private static long nextLong() throws IOException { // return Long.parseLong(next()); // } // // // Get a whole line. // private static String line() throws IOException { // return reader.readLine(); // } // // private static double nextDouble() throws IOException { // return Double.parseDouble(next()); // } }
logn
992_C. Nastya and a Wardrobe
CODEFORCES
import java.io.*; import java.util.*; import java.math.*; //created at 6:06 PM 12/9/11 by Abrackadabra public class A { int IOMode = 0; //0 - consoleIO, 1 - <taskName>.in/out, 2 - input.txt/output.txt, 3 - test case generator String taskName = ""; void solve() throws IOException { int n = nextInt(); int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); Arrays.sort(a); int z = 0; for (int i = 0; i < n; i++) { if (a[i] != 1) z++; } if (z == 0 && n > 1) a[n - 2] = 2; if (n == 1 && a[0] == 1) { out.println(2); return; } out.print("1 "); for (int i = 0; i < n - 1; i++) out.print(a[i] + " "); } public static void main(String[] args) throws IOException { if (args.length > 0 && args[0].equals("Abra")) debugMode = true; new A().run(); } long startTime = System.nanoTime(), tempTime = startTime, finishTime = startTime; long startMem = Runtime.getRuntime().totalMemory(), finishMem = startMem; void run() throws IOException { init(); if (debugMode) { con.println("Start"); con.println("Console output:"); } solve(); finishTime = System.nanoTime(); finishMem = Runtime.getRuntime().totalMemory(); out.flush(); if (debugMode) { int maxSymbols = 1000, c = 0; BufferedReader tbr = new BufferedReader(new FileReader("input.txt")); char[] a = new char[maxSymbols]; tbr.read(a); if (a[0] != 0) { con.println(); con.println("File input:"); con.print(a); } boolean left = true; for (int i = 0; i < maxSymbols; i++) left = left && a[i] != 0; if (left) con.println("..."); else con.println(); tbr = new BufferedReader(new FileReader("output.txt")); a = new char[maxSymbols]; tbr.read(a); if (a[0] != 0) { con.println(); con.println("File output:"); con.print(a); } left = true; for (int i = 0; i < maxSymbols; i++) left = left && a[i] != 0; if (left) con.println("..."); else con.println(); con.println("Time passed: " + (finishTime - startTime) / 1000000000.0 + " sec"); con.println("Memory used: " + (finishMem - startMem) + " bytes"); con.println("Total memory: " + Runtime.getRuntime().totalMemory() + " bytes"); } } boolean tick(double x) { if (System.nanoTime() - tempTime > x) { tempTime = System.nanoTime(); con.println("Tick at " + (tempTime - startTime) / 1000000000 + " sec"); con.print(" "); return true; } return false; } void printTime() { con.println((System.nanoTime() - tempTime) + " nanos passed"); tempTime = System.nanoTime(); } static boolean debugMode = false; PrintStream con = System.out; void init() throws IOException { if (debugMode && IOMode != 3) { br = new BufferedReader(new FileReader("input.txt")); out = new PrintWriter(new FileWriter("output.txt")); } else switch (IOMode) { case 0: br = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); break; case 1: br = new BufferedReader(new FileReader(taskName + ".in")); out = new PrintWriter(new FileWriter(taskName + ".out")); break; case 2: br = new BufferedReader(new FileReader("input.txt")); out = new PrintWriter(new FileWriter("output.txt")); break; case 3: out = new PrintWriter(new FileWriter("input.txt")); break; } } BufferedReader br; PrintWriter out; StringTokenizer in; boolean hasMoreTokens() throws IOException { while (in == null || !in.hasMoreTokens()) { String line = br.readLine(); if (line == null) return false; in = new StringTokenizer(line); } return true; } String nextString() throws IOException { return hasMoreTokens() ? in.nextToken() : null; } int nextInt() throws IOException { return Integer.parseInt(nextString()); } long nextLong() throws IOException { return Long.parseLong(nextString()); } double nextDouble() throws IOException { return Double.parseDouble(nextString()); } }
nlogn
135_A. Replacement
CODEFORCES
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * * @author prakharjain */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); OutputWriter out = new OutputWriter(outputStream); TaskD solver = new TaskD(); solver.solve(1, in, out); out.close(); } static class TaskD { long maxk = (long) 1e18; public void solve(int testNumber, InputReader in, OutputWriter out) { int t = in.nextInt(); long maxn = 1; long val = 0; for (long i = 1; ; i++) { val = 1 + 4 * val; if (val >= maxk) { maxn = i; break; } } long[] vala = new long[(int) maxn + 1]; vala[1] = 1; for (int i = 2; i <= maxn; i++) { vala[i] = 1 + 4 * vala[i - 1]; } o: while (t-- > 0) { long n = in.nextInt(); long k = in.nextLong(); if (n - 1 >= maxn) { out.println("YES " + (n - 1)); continue; } k--; if (k <= vala[(int) n - 1]) { out.println("YES " + (n - 1)); continue; } long cs = n - 1; long cc = 3; int ind = 2; long end = -1; while (k > 0) { if (k >= cc && cs > 0) { k -= cc; cc += (1l << ind); cs--; ind++; } else { // if (cs > 0 && k < cc) { // out.println("YES " + cs); // continue o; // } end = ind; break; } } long fcs = cs; if (k == 0) { out.println("YES " + cs); continue; } k -= vala[(int) n - 1]; cs = n - 1; cc = 3; ind = 2; long rv = 5; long sind = 3; while (k > 0 && ind < end) { k -= rv * vala[(int) cs - 1]; rv += (1l << sind); sind++; cs--; ind++; } if (k <= 0) { out.println("YES " + fcs); } else { out.println("NO"); } } } } static class OutputWriter { private final PrintWriter writer; public OutputWriter(OutputStream outputStream) { writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))); } public OutputWriter(Writer writer) { this.writer = new PrintWriter(writer); } public void print(Object... objects) { for (int i = 0; i < objects.length; i++) { if (i != 0) { writer.print(' '); } writer.print(objects[i]); } } public void println(Object... objects) { print(objects); writer.println(); } public void close() { writer.close(); } } static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private InputReader.SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public static boolean isWhitespace(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public int read() { if (numChars == -1) { throw new InputMismatchException(); } if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) { return -1; } } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') { throw new InputMismatchException(); } res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') { throw new InputMismatchException(); } res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { if (filter != null) { return filter.isSpaceChar(c); } return isWhitespace(c); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } }
logn
1080_D. Olya and magical square
CODEFORCES
import java.io.IOException; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; import java.io.Writer; import java.math.BigInteger; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Egor Kulikov (egor@egork.net) */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); OutputWriter out = new OutputWriter(outputStream); TaskB solver = new TaskB(); solver.solve(1, in, out); out.close(); } } class TaskB { public void solve(int testNumber, InputReader in, OutputWriter out) { int side = in.readInt(); int row = in.readInt() - 1; int column = in.readInt() - 1; int required = in.readInt(); long left = 0; long right = 2 * side - 2; while (left < right) { long current = (left + right) / 2; long result = calculate(row, column, current) + calculate(column, side - row - 1, current) + calculate(side - row - 1, side - column - 1, current) + calculate(side - column - 1, row, current) + 1; if (result >= required) right = current; else left = current + 1; } out.printLine(left); } private long calculate(int row, int column, long current) { column++; long total = 0; long mn = Math.min(row, column); long mx = Math.max(row, column); if (current <= mn) return current * (current + 1) / 2; total += mn * (mn + 1) / 2; current -= mn; mx -= mn; if (current <= mx) return total + mn * current; total += mn * mx; current -= mx; if (current < mn) return total + (mn - 1) * mn / 2 - (mn - current - 1) * (mn - current) / 2; return total + (mn - 1) * mn / 2; } } class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int readInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return isWhitespace(c); } public static boolean isWhitespace(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } class OutputWriter { private final PrintWriter writer; public OutputWriter(OutputStream outputStream) { writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream))); } public OutputWriter(Writer writer) { this.writer = new PrintWriter(writer); } public void print(Object...objects) { for (int i = 0; i < objects.length; i++) { if (i != 0) writer.print(' '); writer.print(objects[i]); } } public void printLine(Object...objects) { print(objects); writer.println(); } public void close() { writer.close(); } }
logn
256_B. Mr. Bender and Square
CODEFORCES
import sun.reflect.generics.tree.Tree; import java.io.*; import java.math.BigInteger; import java.net.Inet4Address; import java.util.*; public class l { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////// ///////// //////// ///////// //////// HHHH HHHH EEEEEEEEEEEEE MMMM MMMM OOOOOO SSSSSSS EEEEEEEEEEEEE ///////// //////// HHHH HHHH EEEEEEEEEEEEE MMMMMM MMMMMM OOO OOO SSSS SSS EEEEEEEEEEEEE ///////// //////// HHHH HHHH EEEEE MMMM MMM MMM MMMM OOO OOO SSSS SSS EEEEE ///////// //////// HHHH HHHH EEEEE MMMM MMMMMM MMMM OOO OOO SSSS EEEEE ///////// //////// HHHH HHHH EEEEE MMMM MMMM OOO OOO SSSSSSS EEEEE ///////// //////// HHHHHHHHHHHHHHHH EEEEEEEEEEE MMMM MMMM OOO OOO SSSSSS EEEEEEEEEEE ///////// //////// HHHHHHHHHHHHHHHH EEEEEEEEEEE MMMM MMMM OOO OOO SSSSSSS EEEEEEEEEEE ///////// //////// HHHH HHHH EEEEE MMMM MMMM OOO OOO SSSS EEEEE ///////// //////// HHHH HHHH EEEEE MMMM MMMM OOO OOO SSS SSSS EEEEE ///////// //////// HHHH HHHH EEEEEEEEEEEEE MMMM MMMM OOO OOO SSS SSSS EEEEEEEEEEEEE ///////// //////// HHHH HHHH EEEEEEEEEEEEE MMMM MMMM OOOOOO SSSSSSS EEEEEEEEEEEEE ///////// //////// ///////// //////// ///////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static long mod = (int) (1e9 + 7); static int n; static StringBuilder sol; static class pair implements Comparable<pair> { int L,R; public pair( int x,int y) { L=x;R=y; } public int compareTo(pair o) { if (L!=o.L)return L-o.L; return o.R-R; } public String toString(){ return L+" "+R; } } static boolean is; public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); //FileWriter f = new FileWriter("C:\\Users\\Ibrahim\\out.txt"); PrintWriter pw = new PrintWriter(System.out); int m = sc.nextInt(); int n = sc.nextInt(); int q = sc.nextInt(); TreeSet<Integer>length= new TreeSet<>(); length.add(0); length.add(n); TreeSet<Integer>width= new TreeSet<>(); width.add(0); width.add(m); TreeMap<Integer,Integer>len= new TreeMap<>(); len.put(n,1); TreeMap<Integer,Integer>wid= new TreeMap<>(); wid.put(m,1); while (q-->0){ String t= sc.next(); if (t.equals("H")) { int x = sc.nextInt(); int k1 = length.ceiling(x); int k2 = length.floor(x); if (x != k1) { int s = k1 - k2; int con = len.get(s); if (con == 1) len.remove(s); else len.put(s, con - 1); len.put((k1 - x), len.getOrDefault((k1 - x), 0) + 1); len.put((x - k2), len.getOrDefault((x - k2), 0) + 1); length.add(x); } } else { int x = sc.nextInt(); int k1 = width.ceiling(x); int k2 = width.floor(x); if (x != k1) { int s = k1 - k2; //System.out.println(s+" "+k1+" "+k2); int con = wid.get(s); if (con == 1) wid.remove(s); else wid.put(s, con - 1); wid.put((k1 - x), wid.getOrDefault((k1 - x), 0) + 1); wid.put((x - k2), wid.getOrDefault((x - k2), 0) + 1); width.add(x); } } pw.println(1l*len.lastKey()*wid.lastKey()); } pw.flush(); } static class Scanner { StringTokenizer st; BufferedReader br; public Scanner(FileReader r) { br = new BufferedReader(r); } public Scanner(InputStream s) { br = new BufferedReader(new InputStreamReader(s)); } public String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } public int nextInt() throws IOException { return Integer.parseInt(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public String nextLine() throws IOException { return br.readLine(); } public double nextDouble() throws IOException { String x = next(); StringBuilder sb = new StringBuilder("0"); double res = 0, f = 1; boolean dec = false, neg = false; int start = 0; if (x.charAt(0) == '-') { neg = true; start++; } for (int i = start; i < x.length(); i++) if (x.charAt(i) == '.') { res = Long.parseLong(sb.toString()); sb = new StringBuilder("0"); dec = true; } else { sb.append(x.charAt(i)); if (dec) f *= 10; } res += Long.parseLong(sb.toString()) / f; return res * (neg ? -1 : 1); } public boolean ready() throws IOException { return br.ready(); } } }
nlogn
527_C. Glass Carving
CODEFORCES
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 * * @author Liavontsi Brechka */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskD solver = new TaskD(); solver.solve(1, in, out); out.close(); } static @SuppressWarnings("Duplicates") class TaskD { public void solve(int testNumber, InputReader in, PrintWriter out) { int n = in.nextInt(); int[] a = in.nextIntArray(n); int m = in.nextInt(); int count = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (a[i] > a[j]) count++; } } StringBuilder res = new StringBuilder(); int l, r, temp, c1, c2; while (m-- > 0) { l = in.nextInt() - 1; r = in.nextInt() - 1; c1 = c2 = 0; for (int i = 0; i < (r - l + 1) / 2; i++) { if (a[l + i] > a[r - i]) c1++; else c2++; temp = a[l + i]; a[l + i] = a[r - i]; a[r - i] = temp; } count = count + c1 - c2; res.append(Math.abs(count) % 2 == 1 ? "odd" : "even").append('\n'); } out.print(res); } } static class InputReader { private final BufferedReader reader; private StringTokenizer tokenizer; public InputReader(InputStream in) { reader = new BufferedReader(new InputStreamReader(in)); } public int[] nextIntArray(int size) { int[] array = new int[size]; for (int i = 0; i < size; ++i) { array[i] = nextInt(); } return array; } public int nextInt() { return Integer.parseInt(next()); } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { tokenizer = new StringTokenizer(readLine()); } return tokenizer.nextToken(); } public String readLine() { String line; try { line = reader.readLine(); } catch (IOException e) { throw new RuntimeException(e); } return line; } } }
quadratic
911_D. Inversion Counting
CODEFORCES
import java.util.Map; import java.io.IOException; import java.io.OutputStreamWriter; import java.math.BigDecimal; import java.io.BufferedWriter; import java.util.Locale; import java.util.InputMismatchException; import java.util.HashMap; import java.util.Set; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.math.BigInteger; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Jacob Jiang */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); OutputWriter out = new OutputWriter(outputStream); TaskB solver = new TaskB(); solver.solve(1, in, out); out.close(); } } class TaskB { public void solve(int testNumber, InputReader in, OutputWriter out) { int n = in.nextInt(); int k = in.nextInt(); int[] a = in.nextIntArray(n); if (k == 1) { out.println("1 1"); return; } int left = -1, right = -1; Counter<Integer> counter = new Counter<Integer>(); while (true) { right++; if (right == n) { out.println("-1 -1"); return; } counter.add(a[right]); if (counter.size() >= k) break; } while (true) { left++; if (counter.get(a[left]) == 1) break; counter.add(a[left], -1); } out.printLine(left + 1, right + 1); } } class InputReader { private InputStream stream; private byte[] buf = new byte[1 << 16]; private int curChar; private int numChars; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int nextInt() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c & 15; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public static boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public int[] nextIntArray(int count) { int[] result = new int[count]; for (int i = 0; i < count; i++) { result[i] = nextInt(); } return result; } } class OutputWriter { private PrintWriter writer; public OutputWriter(OutputStream stream) { writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(stream))); } public OutputWriter(Writer writer) { this.writer = new PrintWriter(writer); } public void print(Object obj) { writer.print(obj); } public void println() { writer.println(); } public void println(String x) { writer.println(x); } public void print(char c) { writer.print(c); } public void close() { writer.close(); } public void printItems(Object... items) { for (int i = 0; i < items.length; i++) { if (i != 0) { print(' '); } print(items[i]); } } public void printLine(Object... items) { printItems(items); println(); } } class Counter<T> extends HashMap<T, Long> { public void add(T obj, long count) { put(obj, get(obj) + count); } public void add(T obj) { put(obj, get(obj) + 1L); } public Long get(Object key) { return containsKey(key) ? super.get(key) : 0L; } }
linear
224_B. Array
CODEFORCES
import java.util.*; public class P023A { public static void main(String[] args) { Scanner in = new Scanner(System.in); String line = in.next(); HashSet<String> hash = new HashSet<String>(); int ans = 0; for (int len = line.length()-1; len > 0; --len) { for (int i = 0; i + len <= line.length(); ++i) { String sub = line.substring(i, i+len); if (hash.contains(sub)) { ans = Math.max(ans, sub.length()); } hash.add(sub); } } System.out.println(ans); } }
cubic
23_A. You're Given a String...
CODEFORCES
import java.io.*; import java.util.*; //import javafx.util.*; import java.math.*; //import java.lang.*; public class Main { // static int n;static ArrayList<Integer> arr[]; // int ans[]; public static void main(String[] args) throws IOException { // Scanner sc=new Scanner(System.in); PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); br = new BufferedReader(new InputStreamReader(System.in)); int n=nextInt(); int arr[]=new int[n]; for(int i=0;i<n;i++){ arr[i]=nextInt(); } Arrays.sort(arr); int c=0; for(int i=0;i<n;i++){ if(arr[i]!=0){ int a=arr[i]; c++; for(int j=i;j<n;j++){ // System.out.println(arr[i]+" "+arr[j]); if(arr[j]%a==0){ arr[j]=0; } } } } pw.println(c); pw.close(); } static long maxSubArraySum(long a[],int size) { long max_so_far = 0, max_ending_here = 0; for (int i = 0; i < size; i++) { max_ending_here = max_ending_here + a[i]; if (max_ending_here < 0) max_ending_here = 0; /* Do not compare for all elements. Compare only when max_ending_here > 0 */ else if (max_so_far < max_ending_here) max_so_far = max_ending_here; } return max_so_far; } public static BufferedReader br; public static StringTokenizer st; public static String next() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (Exception e) { throw new RuntimeException(e); } } return st.nextToken(); } public static Integer nextInt() { return Integer.parseInt(next()); } public static Long nextLong() { return Long.parseLong(next()); } public static Double nextDouble() { return Double.parseDouble(next()); } static class Pair{ int x;int y;int z; Pair(int x,int y,int z){ this.x=x; this.y=y; this.z=z; // this.i=i; } } static class sorting implements Comparator<Pair>{ public int compare(Pair a,Pair b){ //return (a.y)-(b.y); return (a.x-b.x); } } public static int[] na(int n)throws IOException{ int[] a = new int[n]; for(int i = 0;i < n;i++)a[i] = nextInt(); return a; } static class query implements Comparable<query>{ int l,r,idx,block; static int len; query(int l,int r,int i){ this.l=l; this.r=r; this.idx=i; this.block=l/len; } public int compareTo(query a){ return block==a.block?r-a.r:block-a.block; } } static boolean isPrime(int n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (int i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return false; return true; } static long gcd(long a, long b) { if (b == 0) return a; return gcd(b, a % b); } static long modInverse(long a, long m) { long g = gcd(a, m); if (g != 1) return -1; else{ // If a and m are relatively prime, then modulo inverse // is a^(m-2) mode m return (power(a, m - 2, m)); } } // To compute x^y under modulo m static long power(long x, long y, long m){ if (y == 0) return 1; long p = power(x, y / 2, m) % m; p = (p * p) % m; if (y % 2 == 0) return p; else return (x * p) % m; } static long fast_pow(long base,long n,long M){ if(n==0) return 1; if(n==1) return base; long halfn=fast_pow(base,n/2,M); if(n%2==0) return ( halfn * halfn ) % M; else return ( ( ( halfn * halfn ) % M ) * base ) % M; } static long modInverse(long n,int M){ return fast_pow(n,M-2,M); } }
quadratic
1209_A. Paint the Numbers
CODEFORCES
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 * * @author Vadim */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; FastScanner in = new FastScanner(inputStream); PrintWriter out = new PrintWriter(outputStream); D solver = new D(); solver.solve(1, in, out); out.close(); } static class D { public void solve(int testNumber, FastScanner in, PrintWriter out) { int T = in.ni(); for (int t = 0; t < T; t++) { long n = in.nl(), k = in.nl(); if (n == 2 && k == 3) { out.println("NO"); continue; } boolean possible = false; long size = n; long rem = k; for (int i = 0; i <= 31 && size > 0 && rem > 0; i++) { long splits = 1L << (i * 2); //System.out.println("splits = " + splits); rem -= splits; size--; } if (rem > 0) { //System.out.println("rem = " + rem); out.println("NO"); continue; } long path = 1; long i = 0; size = n; long ans = 0; while (path <= k && size > 0) { //System.out.printf("path=%d k=%d size=%d%n", path, k, size); k -= path; path = (1L << i + 2) - 1; size--; i++; } //System.out.printf("size=%d k=%d%n", size, k); out.println("YES " + size); } } } static class FastScanner { private BufferedReader in; private StringTokenizer st; public FastScanner(InputStream stream) { in = new BufferedReader(new InputStreamReader(stream)); } public String ns() { while (st == null || !st.hasMoreTokens()) { try { String rl = in.readLine(); if (rl == null) { return null; } st = new StringTokenizer(rl); } catch (IOException e) { throw new RuntimeException(e); } } return st.nextToken(); } public int ni() { return Integer.parseInt(ns()); } public long nl() { return Long.parseLong(ns()); } } }
logn
1080_D. Olya and magical square
CODEFORCES
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void main(String[] args) throws IOException { PrintWriter out = new PrintWriter(System.out); //Scanner sc = new Scanner(); Reader in = new Reader(); Main solver = new Main(); solver.solve(out, in); out.flush(); out.close(); } static int INF = (int)1e5*4*4+5; static int maxn = (int)1e5*2+1; static int mod=(int)1e9+7 ; static int n,m,k,t,q,x,a,b,y; static ArrayList<Integer> adj[]; static int[] dist,parent,back; static boolean[] vis,vist; static int root=0,ans=1; void solve(PrintWriter out, Reader in) throws IOException{ n = in.nextInt(); if(n==1) {out.println(1);return;} adj = new ArrayList[n+1]; for(int i=1;i<=n;i++) adj[i] = new ArrayList<Integer>(); int u,v; for(int i=0;i<n-1;i++){ u = in.nextInt(); v = in.nextInt(); adj[u].add(v); adj[v].add(u); } vist = new boolean[n+1]; vis = new boolean[n+1]; vist[1] =true; makeroot(1); parent = new int[n+1]; dist = new int[n+1]; back = new int[n+1]; dfs(root,0); calcdist(root); vist = new boolean[n+1]; vis = new boolean[n+1]; vist[root] =true; PriorityQueue<Node> pq = new PriorityQueue<Node>(); for(int i=1;i<=n;i++){ if(i!=root) pq.add(new Node(i,dist[i])); } Node elm; int rt = root; out.print(1); makeroot(root); removeNodes(root,rt); ans+=dist[rt]; out.print(" "+ans); int itr=2; for(int i=2;i<=n;i++){ elm = pq.remove(); if(vis[elm.idx]) continue; removeNodes(back[elm.idx],elm.idx); ans += elm.dist+1; out.print(" "+ans); itr++; } for(int i=itr;i<n;i++) out.print(" "+ans); out.println(); } //<> static class Node implements Comparable<Node>{ int dist,idx; Node(int idx,int dist){ this.idx = idx; this.dist = dist; } public int compareTo(Node o) { return o.dist-this.dist; } } static void removeNodes(int s,int e){ vis[s]=true; while(s!=e){ vis[s] = true; s = parent[s]; } vis[s]=true; return; } static int calcdist(int s){ int res=0; int tmp=0; for(int e:adj[s]){ if(e!=parent[s]){ tmp= calcdist(e); if(1+tmp>res){ res = 1+tmp; back[s] = back[e]; } } } if(res==0) back[s]=s; return dist[s] = res; } static void dfs(int s,int p){ for(int e:adj[s]){ if(e!=p){ parent[e]=s; dfs(e,s); } } return; } static void makeroot(int s){ Queue<Integer> q = new LinkedList<>(); q.add(s); int elm=0; while(q.size()!=0){ elm = q.remove(); for(int e:adj[elm]){ if(!vist[e]){ vist[e]=true; q.add(e); root = e; } } } return; } static class Reader { private InputStream mIs; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public Reader() { this(System.in); } public Reader(InputStream is) { mIs = is; } public int read() { if (numChars == -1) { throw new InputMismatchException(); } if (curChar >= numChars) { curChar = 0; try { numChars = mIs.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) { return -1; } } return buf[curChar++]; } public String nextLine() { int c = read(); while (isSpaceChar(c)) { c = read(); } StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isEndOfLine(c)); return res.toString(); } public String next() { int c = read(); while (isSpaceChar(c)) { c = read(); } StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } double nextDouble() { return Double.parseDouble(next()); } public long nextLong() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') { throw new InputMismatchException(); } res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public int nextInt() { int c = read(); while (isSpaceChar(c)) { c = read(); } int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') { throw new InputMismatchException(); } res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public boolean isEndOfLine(int c) { return c == '\n' || c == '\r' || c == -1; } } }
nlogn
958_B2. Maximum Control (medium)
CODEFORCES
import java.util.*; import java.io.*; public class GG { public static void main(String[] args) { FastScanner scanner = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int N = scanner.nextInt(); int M = scanner.nextInt(); int K = scanner.nextInt(); int C = scanner.nextInt(); int D = scanner.nextInt(); MinCostMaxFlowSolver solver = new EdmondsKarp(); int[] people = new int[K]; for(int i = 0; i < K; i++) people[i] = scanner.nextInt()-1; Node src = solver.addNode(); Node snk = solver.addNode(); int amt = 350; Node[][] timeNodes = new Node[N][amt]; for(int i = 0; i < N; i++) { for(int j = 1; j < amt; j++) { timeNodes[i][j] = solver.addNode(); if (j > 1) solver.link(timeNodes[i][j-1], timeNodes[i][j], Integer.MAX_VALUE, 0); } } for(int i = 0; i < K; i++) { solver.link(src, timeNodes[people[i]][1], 1, 0); } for(int i = 1; i < amt; i++) { for(int j = 0; j < K; j++) { solver.link(timeNodes[0][i], snk, 1, C*i-C); } } for(int i =0; i < M; i++) { int a = scanner.nextInt()-1; int b = scanner.nextInt()-1; for(int j = 1; j < amt-1; j++) { int prev = 0; for(int k = 1; k <= K; k++) { solver.link(timeNodes[a][j], timeNodes[b][j + 1], 1, D*k*k- prev); solver.link(timeNodes[b][j], timeNodes[a][j + 1], 1, D*k*k - prev); prev = D * k * k; } } } long[] ret = solver.getMinCostMaxFlow(src, snk); out.println(ret[1]); out.flush(); } public static class Node { // thou shall not create nodes except through addNode() private Node() { } List<Edge> edges = new ArrayList<Edge>(); int index; // index in nodes array } public static class Edge { boolean forward; // true: edge is in original graph Node from, to; // nodes connected long flow; // current flow final long capacity; Edge dual; // reference to this edge's dual long cost; // only used for MinCost. protected Edge(Node s, Node d, long c, boolean f) { forward = f; from = s; to = d; capacity = c; } long remaining() { return capacity - flow; } void addFlow(long amount) { flow += amount; dual.flow -= amount; } } public static abstract class MaxFlowSolver { List<Node> nodes = new ArrayList<Node>(); public void link(Node n1, Node n2, long capacity) { link(n1, n2, capacity, 1); } public void link(Node n1, Node n2, long capacity, long cost) { Edge e12 = new Edge(n1, n2, capacity, true); Edge e21 = new Edge(n2, n1, 0, false); e12.dual = e21; e21.dual = e12; n1.edges.add(e12); n2.edges.add(e21); e12.cost = cost; e21.cost = -cost; } void link(int n1, int n2, long capacity) { link(nodes.get(n1), nodes.get(n2), capacity); } protected MaxFlowSolver(int n) { for (int i = 0; i < n; i++) addNode(); } protected MaxFlowSolver() { this(0); } public abstract long getMaxFlow(Node src, Node snk); public Node addNode() { Node n = new Node(); n.index = nodes.size(); nodes.add(n); return n; } } static abstract class MinCostMaxFlowSolver extends MaxFlowSolver { // returns [maxflow, mincost] abstract long [] getMinCostMaxFlow(Node src, Node snk); // unavoidable boiler plate MinCostMaxFlowSolver () { this(0); } MinCostMaxFlowSolver (int n) { super(n); } } static class EdmondsKarp extends MinCostMaxFlowSolver { EdmondsKarp () { this(0); } EdmondsKarp (int n) { super(n); } long minCost; @Override public long [] getMinCostMaxFlow(Node src, Node snk) { long maxflow = getMaxFlow(src, snk); return new long [] { maxflow, minCost }; } static final long INF = Long.MAX_VALUE/4; @Override public long getMaxFlow(Node src, Node snk) { final int n = nodes.size(); final int source = src.index; final int sink = snk.index; long flow = 0; long cost = 0; long[] potential = new long[n]; // allows Dijkstra to work with negative edge weights while (true) { Edge[] parent = new Edge[n]; // used to store an augmenting path long[] dist = new long[n]; // minimal cost to vertex Arrays.fill(dist, INF); dist[source] = 0; PriorityQueue<Item> que = new PriorityQueue<Item>(); que.add(new Item(0, source)); while (!que.isEmpty()) { Item item = que.poll(); if (item.dist != dist[item.v]) continue; for (Edge e : nodes.get(item.v).edges) { long temp = dist[item.v] + e.cost + potential[item.v] - potential[e.to.index]; if (e.capacity > e.flow && dist[e.to.index] > temp) { dist[e.to.index] = temp; parent[e.to.index] = e; que.add(new Item(temp, e.to.index)); } } } if (parent[sink] == null) break; for (int i = 0; i < n; i++) if (parent[i] != null) potential[i] += dist[i]; long augFlow = Long.MAX_VALUE; for (int i = sink; i != source; i = parent[i].from.index) augFlow = Math.min(augFlow, parent[i].capacity - parent[i].flow); for (int i = sink; i != source; i = parent[i].from.index) { Edge e = parent[i]; e.addFlow(augFlow); cost += augFlow * e.cost; } flow += augFlow; } minCost = cost; return flow; } static class Item implements Comparable<Item> { long dist; int v; public Item(long dist, int v) { this.dist = dist; this.v = v; } public int compareTo(Item that) { return Long.compare(this.dist, that.dist); } } } public static class FastScanner { BufferedReader br; StringTokenizer st; public FastScanner(Reader in) { br = new BufferedReader(in); } public FastScanner() { this(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String readNextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } int[] readIntArray(int n) { int[] a = new int[n]; for (int idx = 0; idx < n; idx++) { a[idx] = nextInt(); } return a; } } }
cubic
1187_G. Gang Up
CODEFORCES
import java.io.*; import java.util.*; /* polyakoff */ public class Main { static FastReader in; static PrintWriter out; static Random rand = new Random(); static final int oo = (int) 1e9 + 10; static final long OO = (long) 1e18 + 10; static final int MOD = (int) 1e9 + 7; static int M; static long[] f, fi, two; static long pow(long a, long b) { long res = 1; while (b != 0) { if ((b & 1) == 1) res = (res * a) % M; a = (a * a) % M; b >>= 1; } return res; } static long C(int n, int k) { return f[n] * fi[k] % M * fi[n - k] % M; } static void prepare(int n) { f = new long[n]; f[0] = 1; for (int i = 1; i < n; i++) { f[i] = (f[i - 1] * i) % M; } fi = new long[n]; for (int i = 0; i < n; i++) { fi[i] = pow(f[i], M - 2); } two = new long[n]; two[0] = 1; for (int i = 1; i < n; i++) { two[i] = (two[i - 1] * 2) % M; } } static void solve() { int n = in.nextInt(); M = in.nextInt(); prepare(n + 10); long[][] dp = new long[n + 1][n]; for (int i = 1; i <= n; i++) { dp[i][1] = two[i - 1]; } for (int i = 1; i <= n; i++) { for (int j = 2; j < n; j++) { for (int k = 1; k <= i - 2; k++) { if (k < j - 2) continue; int len = i - k - 1; dp[i][j] = (dp[i][j] + dp[k][j - 1] * two[len - 1] % M * C(k - (j - 2) + len, len) % M) % M; } } } long ans = 0; for (int j = 1; j < n; j++) { ans = (ans + dp[n][j]) % M; } out.println(ans); } public static void main(String[] args) { in = new FastReader(); out = new PrintWriter(System.out); int t = 1; // t = in.nextInt(); while (t-- > 0) { solve(); } out.flush(); out.close(); } static class FastReader { BufferedReader br; StringTokenizer st; FastReader() { this(System.in); } FastReader(String file) throws FileNotFoundException { this(new FileInputStream(file)); } FastReader(InputStream is) { br = new BufferedReader(new InputStreamReader(is)); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String next() { while (st == null || !st.hasMoreTokens()) { st = new StringTokenizer(nextLine()); } return st.nextToken(); } String nextLine() { String line; try { line = br.readLine(); } catch (IOException e) { throw new RuntimeException(e); } return line; } } }
cubic
1515_E. Phoenix and Computers
CODEFORCES
import java.util.Scanner; public class D { public static void main(String[] args) { Scanner s = new Scanner(System.in); long l = s.nextLong(); long r = s.nextLong(); long a = l ^ r; long b = a; while (b != 0) { a = b; b = (b-1) & b; } if (a != 0) { a = (a << 1) - 1; } System.out.println(a); } }
logn
276_D. Little Girl and Maximum XOR
CODEFORCES
/** * Created by IntelliJ IDEA. * User: dev_il * Date: 03.08.2010 * Time: 0:59:04 * To change this template use File | Settings | File Templates. */ import java.io.*; import static java.lang.Math.*; import java.util.*; public class IQTest implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok; public static void main(String[] args) { new Thread(new IQTest()).start(); } void solve() throws IOException { int n = nextInt(); List<Integer> l1 = new ArrayList<Integer>(); List<Integer> l2 = new ArrayList<Integer>(); for (int i = 0; i < n; ++i) { int k = nextInt(); if (k % 2 == 0) l1.add(i + 1); else l2.add(i + 1); } if (l1.size() == 1) out.println(l1.get(0)); else out.println(l2.get(0)); } public void run() { try { in = new BufferedReader(new InputStreamReader(System.in)); // in = new BufferedReader(new FileReader(new File("input.txt"))); out = new PrintWriter(System.out); // out = new PrintWriter(new File("output.txt")); solve(); out.flush(); out.close(); in.close(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } String nextLine() throws IOException { tok = null; return in.readLine(); } double nextDouble() throws IOException { return Double.parseDouble(nextToken()); } int nextInt() throws IOException { return Integer.parseInt(nextToken()); } String nextToken() throws IOException { while (tok == null || !tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); } return tok.nextToken(); } }
linear
25_A. IQ test
CODEFORCES
import java.io.*; import java.math.*; import java.util.*; public class Main { public static void main(String args[]) throws IOException { new Main().run(); } StreamTokenizer in; PrintWriter out; public void run() throws IOException { in =new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); out = new PrintWriter(new OutputStreamWriter(System.out)); /*out = new PrintWriter(new FileWriter("output.txt")); in =new StreamTokenizer(new BufferedReader(new FileReader("input.txt")));*/ solve(); out.flush(); } public double nextInt() throws IOException { in.nextToken(); return in.nval; } public void solve() throws IOException { double a=nextInt(),v=nextInt(),l=nextInt(),d=nextInt(),w=nextInt(); double s=w*w/(2*a); if(s>d || w>v) { double t=v*v/(2*a); if(t>l) { double f=2*l/a; out.print(String.format("%.10f",Math.sqrt(f))); return; } double f=v/a; double k=(l-t)/v; out.print(String.format("%.10f",f+k)); return; } double t; if((2*v*v-w*w)/(2*a)<d) t=v/a+(v-w)/a+(d-(2*v*v-w*w)/(2*a))/v; else { double v1=Math.sqrt((2*a*d+w*w)/2); t=v1/a+(v1-w)/a; } double r=l-d; double tr=(v*v-w*w)/(2*a); if(tr>r) { double t1=(-w+Math.sqrt(w*w+2*a*r))/a; out.print(String.format("%.10f",t+t1)); return; } r-=(v*v-w*w)/(2*a); t+=(v-w)/a; out.print(String.format("%.10f",t+r/v)); } }
constant
5_D. Follow Traffic Rules
CODEFORCES
import java.io.*; import java.util.*; import java.text.*; import java.math.*; public class A { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); int t = Integer.parseInt(st.nextToken()); State[] s = new State[n]; for(int i = 0; i < n; i++) { st = new StringTokenizer(br.readLine()); s[i] = new State(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken())); } Arrays.sort(s); int num = 2; for(int i = 1; i < s.length; i++) { int dist = s[i].x - s[i-1].x; dist *= 2; int size = s[i].d + s[i-1].d; size += 2 * t; if(dist == size) num++; else if(dist > size) num += 2; } System.out.println(num); } static class State implements Comparable<State> { public int x,d; public State(int a, int b) { x=a; d=b; } public int compareTo(State s) { return x - s.x; } } }
nlogn
15_A. Cottage Village
CODEFORCES
import java.io.*; import java.util.*; public class A{ private BufferedReader in; private StringTokenizer st; void solve() throws IOException{ int n = nextInt(); System.out.println(3 * n/2); } A() throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); eat(""); solve(); } private void eat(String str) { st = new StringTokenizer(str); } String next() throws IOException { while (!st.hasMoreTokens()) { String line = in.readLine(); if (line == null) { return null; } eat(line); } return st.nextToken(); } int nextInt() throws IOException { return Integer.parseInt(next()); } long nextLong() throws IOException { return Long.parseLong(next()); } double nextDouble() throws IOException { return Double.parseDouble(next()); } public static void main(String[] args) throws IOException { new A(); } int gcd(int a,int b){ if(b>a) return gcd(b,a); if(b==0) return a; return gcd(b,a%b); } }
constant
84_A. Toy Army
CODEFORCES
import java.util.*; import java.io.*; import java.math.*; public class a extends Thread { BufferedReader bf; PrintWriter out; FastScanner in; void solve() throws Exception { long n = in.nextLong(); long f[] = new long[2001]; int i = 2; f[0] = 0; f[1] = 1; while (true){ f[i] = f[i-1] + f[i-2]; if (f[i] < n) i++; else break; } if (n == 1) out.println("1 0 0"); else if (n == 0) out.println("0 0 0"); else if (i - 3 >= 0) out.println(f[i-2] +" " + f[i-2] + " " +f[i-3]); else out.println("I'm too stupid to solve this problem"); } public void run() { try { bf = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); in = new FastScanner(bf); solve(); out.flush(); } catch (Exception ex) { ex.printStackTrace(); } finally { out.close(); } } public static void main(String args[]) { new a().start(); } class FastScanner { BufferedReader bf; StringTokenizer st; public FastScanner(BufferedReader bf) { this.bf = bf; } public String nextToken() throws Exception { while (st == null || !st.hasMoreTokens()) { st = new StringTokenizer(bf.readLine()); } return st.nextToken(); } public int nextInt() throws Exception { return Integer.parseInt(nextToken()); } public long nextLong() throws Exception { return Long.parseLong(nextToken()); } public Double nextDouble() throws Exception { return Double.parseDouble(nextToken()); } public BigInteger nextBigInteger() throws Exception { return new BigInteger(nextToken()); } } }
constant
199_A. Hexadecimal's theorem
CODEFORCES
import java.util.*; import java.io.*; public class Solution { public static void main(String [] args) throws IOException { PrintWriter pw=new PrintWriter(System.out);//use pw.println() not pw.write(); BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine()); /* inputCopy 5 3 xyabd outputCopy 29 inputCopy 7 4 problem outputCopy 34 inputCopy 2 2 ab outputCopy -1 inputCopy 12 1 abaabbaaabbb outputCopy 1 */ int n=Integer.parseInt(st.nextToken()); int k=Integer.parseInt(st.nextToken()); st=new StringTokenizer(br.readLine()); String str=st.nextToken(); char [] arr=str.toCharArray(); Arrays.sort(arr); int weight=arr[0]-96; char a=arr[0]; int included=1; for(int i=1;i<arr.length;++i) { if(included==k) break; char c=arr[i]; if(c-a<2) continue; weight+=arr[i]-96; ++included; a=arr[i]; } if(included==k) pw.println(weight); else pw.println(-1); pw.close();//Do not forget to write it after every program return statement !! } } /* →Judgement Protocol Test: #1, time: 77 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 5 3 xyabd Output 29 Answer 29 Checker Log ok 1 number(s): "29" Test: #2, time: 78 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 7 4 problem Output 34 Answer 34 Checker Log ok 1 number(s): "34" Test: #3, time: 139 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 2 2 ab Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #4, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 12 1 abaabbaaabbb Output 1 Answer 1 Checker Log ok 1 number(s): "1" Test: #5, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 50 13 qwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa Output 169 Answer 169 Checker Log ok 1 number(s): "169" Test: #6, time: 108 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 50 14 qwertyuiopasdfghjklzxcvbnmaaaaaaaaaaaaaaaaaaaaaaaa Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #7, time: 93 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 1 1 a Output 1 Answer 1 Checker Log ok 1 number(s): "1" Test: #8, time: 108 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 50 1 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Output 1 Answer 1 Checker Log ok 1 number(s): "1" Test: #9, time: 77 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 50 2 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #10, time: 92 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 13 13 uwgmkyqeiaocs Output 169 Answer 169 Checker Log ok 1 number(s): "169" Test: #11, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 13 13 hzdxpbfvrltnj Output 182 Answer 182 Checker Log ok 1 number(s): "182" Test: #12, time: 93 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 1 1 n Output 14 Answer 14 Checker Log ok 1 number(s): "14" Test: #13, time: 92 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 10 8 smzeblyjqw Output 113 Answer 113 Checker Log ok 1 number(s): "113" Test: #14, time: 78 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 20 20 tzmvhskkyugkuuxpvtbh Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #15, time: 109 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 30 15 wjzolzzkfulwgioksfxmcxmnnjtoav Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #16, time: 93 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 40 30 xumfrflllrrgswehqtsskefixhcxjrxbjmrpsshv Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #17, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 50 31 ahbyyoxltryqdmvenemaqnbakglgqolxnaifnqtoclnnqiabpz Output -1 Answer -1 Checker Log ok 1 number(s): "-1" Test: #18, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 10 7 iuiukrxcml Output 99 Answer 99 Checker Log ok 1 number(s): "99" Test: #19, time: 109 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 38 2 vjzarfykmrsrvwbwfwldsulhxtykmjbnwmdufa Output 5 Answer 5 Checker Log ok 1 number(s): "5" Test: #20, time: 77 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 12 6 fwseyrarkwcd Output 61 Answer 61 Checker Log ok 1 number(s): "61" Test: #21, time: 109 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 2 2 ac Output 4 Answer 4 Checker Log ok 1 number(s): "4" Test: #22, time: 108 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 1 1 c Output 3 Answer 3 Checker Log ok 1 number(s): "3" Test: #23, time: 124 ms., memory: 0 KB, exit code: 0, checker exit code: 0, verdict: OK Input 2 2 ad Output 5 Answer 5 Checker Log ok 1 number(s): "5" Test: #24, time: 77 ms., memory: 0 KB, exit code: 0, checker exit code: 1, verdict: WRONG_ANSWER Input 2 1 ac Output -1 Answer 1 Checker Log wrong answer 1st number */
linear
1011_A. Stages
CODEFORCES
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.Arrays; import java.util.StringTokenizer; public class C { static StringTokenizer st; static BufferedReader br; static PrintWriter pw; public static void main(String[] args) throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int n = nextInt(); char[]a = next().toCharArray(); int[]cnt = new int[256]; for (int i = 0; i < n; i++) { cnt[a[i]]++; } int alldiff = 0; for (int i = 0; i < 256; i++) { if (cnt[i] > 0) alldiff++; } Arrays.fill(cnt, 0); int diff = 0, right = -1, ans = n+5; for (int i = 0; i < n; i++) { if (right < i) { cnt[a[i]]++; diff = 1; right = i; } while (right < n-1 && diff < alldiff) { right++; cnt[a[right]]++; if (cnt[a[right]]==1) diff++; } if (diff==alldiff && right-i+1 < ans) { ans = right-i+1; } cnt[a[i]]--; if (cnt[a[i]]==0) diff--; } System.out.println(ans); pw.close(); } private static int nextInt() throws IOException { return Integer.parseInt(next()); } private static long nextLong() throws IOException { return Long.parseLong(next()); } private static double nextDouble() throws IOException { return Double.parseDouble(next()); } private static String next() throws IOException { while (st==null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } }
linear
701_C. They Are Everywhere
CODEFORCES
import java.io.*; import java.util.*; public class MainG { static StdIn in = new StdIn(); static PrintWriter out = new PrintWriter(System.out); static long M=(long)1e9+7; public static void main(String[] args) { char[] cs = in.next().toCharArray(); int n=cs.length; int[] x = new int[n]; for(int i=0; i<n; ++i) x[i]=cs[i]-'0'; long[] dp1 = new long[n+1]; for(int i=0; i<n; ++i) dp1[i+1]=(x[i]+dp1[i]*10)%M; long ans=0; for(int d1=1; d1<=9; ++d1) { long[][] dp2 = new long[2][n+1]; for(int i=0; i<n; ++i) { dp2[0][i+1]=x[i]>=d1?(10*dp2[0][i]+1)%M:dp2[0][i]; for(int d2=0; d2<x[i]; ++d2) dp2[1][i+1]=((d2>=d1?10*(dp2[0][i]+dp2[1][i])+dp1[i]+1:dp2[0][i]+dp2[1][i])+dp2[1][i+1])%M; for(int d2=x[i]; d2<=9; ++d2) dp2[1][i+1]=((d2>=d1?10*dp2[1][i]+dp1[i]:dp2[1][i])+dp2[1][i+1])%M; } ans+=dp2[0][n]+dp2[1][n]; } out.println(ans%M); out.close(); } interface Input { public String next(); public String nextLine(); public int nextInt(); public long nextLong(); public double nextDouble(); } static class StdIn implements Input { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public StdIn() { din = new DataInputStream(System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public StdIn(InputStream in) { try{ din = new DataInputStream(in); } catch(Exception e) { throw new RuntimeException(); } buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public String next() { int c; while((c=read())!=-1&&(c==' '||c=='\n'||c=='\r')); StringBuilder s = new StringBuilder(); while (c != -1) { if (c == ' ' || c == '\n'||c=='\r') break; s.append((char)c); c=read(); } return s.toString(); } public String nextLine() { int c; while((c=read())!=-1&&(c==' '||c=='\n'||c=='\r')); StringBuilder s = new StringBuilder(); while (c != -1) { if (c == '\n'||c=='\r') break; s.append((char)c); c = read(); } return s.toString(); } public int nextInt() { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do ret = ret * 10 + c - '0'; while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public int[] readIntArray(int n) { int[] ar = new int[n]; for(int i=0; i<n; ++i) ar[i]=nextInt(); return ar; } public long nextLong() { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do ret = ret * 10 + c - '0'; while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long[] readLongArray(int n) { long[] ar = new long[n]; for(int i=0; i<n; ++i) ar[i]=nextLong(); return ar; } public double nextDouble() { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do ret = ret * 10 + c - '0'; while ((c = read()) >= '0' && c <= '9'); if (c == '.') while ((c = read()) >= '0' && c <= '9') ret += (c - '0') / (div *= 10); if (neg) return -ret; return ret; } private void fillBuffer() throws IOException { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } private byte read() { try{ if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } catch(IOException e) { throw new RuntimeException(); } } public void close() throws IOException { if (din == null) return; din.close(); } } }
quadratic
908_G. New Year and Original Order
CODEFORCES
import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class Main implements Runnable { static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; private BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars==-1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if(numChars <= 0) return -1; } return buf[curChar++]; } public String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } public int nextInt() { int c = read(); while(isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if(c<'0'||c>'9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nextLong() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public double nextDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, nextInt()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public String readString() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } public String next() { return readString(); } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } } public static void main(String args[]) throws Exception { new Thread(null, new Main(),"Main",1<<26).start(); } long fast_pow(long a, long b) { if(b == 0) return 1L; long val = fast_pow(a, b / 2); if(b % 2 == 0) return val * val % mod; else return val * val % mod * a % mod; } long mod = (long)1e9 + 7; public void run() { InputReader sc = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); long x = sc.nextLong(); long k = sc.nextLong(); if(x == 0) { w.print("0"); w.close(); return; } x = x % mod; long pkp1 = fast_pow(2, k + 1L); long pk = fast_pow(2, k); long sub = (pk - 1 + mod) % mod * pk % mod; long add = x * pkp1 % mod * pk % mod; long num = (add - sub + mod) % mod; long deninv = fast_pow(pk, mod - 2); long ans = num * deninv % mod; w.print(ans); w.close(); } }
logn
992_C. Nastya and a Wardrobe
CODEFORCES
import java.util.*; import java.math.*; import java.io.PrintStream; import static java.lang.Math.*; public class Task275A { public static Scanner in = new Scanner(System.in); public static PrintStream out = System.out; public static void main(String[] args) { long l = in.nextLong(); long r = in.nextLong(); if (l % 2 == 1) { l++; } if (r - l < 2) { out.print(-1); } else { out.print(l + " " + (l + 1) + " " + (l + 2)); } } }
constant
483_A. Counterexample
CODEFORCES
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StreamTokenizer; public class A25 { static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); static PrintWriter out = new PrintWriter(System.out); static int nextInt() throws Exception { in.nextToken(); return (int)in.nval; } static String nextString() throws Exception { in.nextToken(); return in.sval; } public static void main(String[] args) throws Exception { int n = nextInt(); int[] c = new int[2]; int[] f = new int[2]; for (int i = 0; i < n; i++) { int x = nextInt(), p = x%2; if (c[p]++ == 0) f[p] = i+1; } out.println(c[0] == 1 ? f[0] : f[1]); out.flush(); } }
linear
25_A. IQ test
CODEFORCES
import java.io.*; import java.util.*; public class MainF { public static void main(String[]args) throws IOException{ BufferedReader br = new BufferedReader(new FileReader(new File("input.txt"))); BufferedWriter bw = new BufferedWriter(new FileWriter(new File("output.txt"))); String S = br.readLine(); String[]J = S.split(" "); int N = Integer.parseInt(J[0]); int M = Integer.parseInt(J[1]); int K = Integer.parseInt(br.readLine()); int[]x = new int[K]; int[]y = new int[K]; S = br.readLine(); J = S.split(" "); for(int i = 0; i<2*K; i = i + 2){ x[i/2] = Integer.parseInt(J[i]); y[i/2] = Integer.parseInt(J[i+1]); } int ans = -1; int ansX = -1; int ansY = -1; for (int i = 1; i<=N; i++){ for (int j = 1; j<=M; j++){ int W = M + N; for (int k = 0; k<K; k++){ W = Math.min(W, Math.abs(i-x[k]) + Math.abs(j-y[k])); } if (W < ans)continue; ans = W; ansX = i; ansY = j; } } bw.write(Integer.toString(ansX)+" "+Integer.toString(ansY)); br.close(); bw.close(); } }
cubic
35_C. Fire Again
CODEFORCES
import java.io.*; import java.util.*; public class A implements Runnable{ public static void main (String[] args) {new Thread(null, new A(), "_cf", 1 << 28).start();} public void run() { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); System.err.println("Go!"); int n = fs.nextInt(); int d = fs.nextInt(); int[] a = fs.nextIntArray(n); sort(a); long res = 0; if(n == 1) { System.out.println(2); return; } HashSet<Integer> set = new HashSet<>(); for(int i = 0; i < n; i++) { int one = a[i] - d; int min = Integer.MAX_VALUE; for(int j = 0; j < n; j++) { int dist = Math.abs(a[j] - one); min = Math.min(min, dist); } if(min == d) set.add(one); one = a[i] + d; min = Integer.MAX_VALUE; for(int j = 0; j < n; j++) { int dist = Math.abs(a[j] - one); min = Math.min(min, dist); } if(min == d) set.add(one); } System.out.println(set.size()); out.close(); } void sort (int[] a) { int n = a.length; for(int i = 0; i < 50; i++) { Random r = new Random(); int x = r.nextInt(n), y = r.nextInt(n); int temp = a[x]; a[x] = a[y]; a[y] = temp; } Arrays.sort(a); } class FastScanner { public int BS = 1<<16; public char NC = (char)0; byte[] buf = new byte[BS]; int bId = 0, size = 0; char c = NC; double num = 1; BufferedInputStream in; public FastScanner() { in = new BufferedInputStream(System.in, BS); } public FastScanner(String s) throws FileNotFoundException { in = new BufferedInputStream(new FileInputStream(new File(s)), BS); } public char nextChar(){ while(bId==size) { try { size = in.read(buf); }catch(Exception e) { return NC; } if(size==-1)return NC; bId=0; } return (char)buf[bId++]; } public int nextInt() { return (int)nextLong(); } public long nextLong() { num=1; boolean neg = false; if(c==NC)c=nextChar(); for(;(c<'0' || c>'9'); c = nextChar()) { if(c=='-')neg=true; } long res = 0; for(; c>='0' && c <='9'; c=nextChar()) { res = (res<<3)+(res<<1)+c-'0'; num*=10; } return neg?-res:res; } public double nextDouble() { double cur = nextLong(); return c!='.' ? cur:cur+nextLong()/num; } public String next() { StringBuilder res = new StringBuilder(); while(c<=32)c=nextChar(); while(c>32) { res.append(c); c=nextChar(); } return res.toString(); } public String nextLine() { StringBuilder res = new StringBuilder(); while(c<=32)c=nextChar(); while(c!='\n') { res.append(c); c=nextChar(); } return res.toString(); } public boolean hasNext() { if(c>32)return true; while(true) { c=nextChar(); if(c==NC)return false; else if(c>32)return true; } } public int[] nextIntArray(int n) { int[] res = new int[n]; for(int i = 0; i < n; i++) res[i] = nextInt(); return res; } } }
linear
1004_A. Sonya and Hotels
CODEFORCES
import java.util.Scanner; public class Fishes { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); double[][] p = new double[n][n]; double[] dp = new double[1 << 18]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { p[i][j] = Double.parseDouble(s.next()); } } int last = 1 << n; dp[last - 1] = 1.0; for (int i = last - 2; i > 0; i--) { int res = 0; for (int j = 0; j < n; j++) { if (((1 << j) & i) > 0) res++; } res++; res = res * (res - 1) / 2; for (int j = 0; j < n; j++) { if (((1 << j) & i) == 0) { for (int z = 0; z < n; z++) { if (((1 << z) & i) > 0) { dp[i] += dp[i | (1 << j)] * 1.0 / res * p[z][j]; } } } } } for (int i = 0; i < n; i++) { System.out.print(dp[1 << i] + " "); } } }
np
16_E. Fish
CODEFORCES
import java.io.*; import java.util.*; import static java.lang.Math.*; public class codeforces { public static long cnt = 0; public static void f(int g1, int g2, int g3, int last) { if (g1 == 0 && g2 == 0 && g3 == 0) cnt++; if (g1 > 0 && last != 1) f(g1 - 1, g2, g3, 1); if (g2 > 0 && last != 2) f(g1, g2 - 1, g3, 2); if (g3 > 0 && last != 3) f(g1, g2, g3 - 1, 3); } public static void main(String[] args) throws IOException { BufferedReader scan = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(scan.readLine()); int n = Integer.parseInt(st.nextToken()); int t = Integer.parseInt(st.nextToken()); int T[] = new int[n]; int G[] = new int[n]; for (int i = 0; i < n; i++) { st = new StringTokenizer(scan.readLine()); T[i] = Integer.parseInt(st.nextToken()); G[i] = Integer.parseInt(st.nextToken()); } long ans = 0; for (int mask = 1; mask < (1 << n); mask++) { int sum = 0; int g1 = 0; int g2 = 0; int g3 = 0; for (int i = 0; i < n; i++) { if (((1 << i) & mask) > 0) { sum += T[i]; if (G[i] == 1) g1++; if (G[i] == 2) g2++; if (G[i] == 3) g3++; } } cnt = 0; if (sum == t) f(g1, g2, g3, -1); for (long i = 1; i <= g1; i++) cnt *= i; for (long i = 1; i <= g2; i++) cnt *= i; for (long i = 1; i <= g3; i++) cnt *= i; ans += cnt; } System.out.println(ans % 1000000007); } }
np
1185_G1. Playlist for Polycarp (easy version)
CODEFORCES
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; import java.awt.Point; 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 = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskC solver = new TaskC(); solver.solve(1, in, out); out.close(); } static class TaskC { public void solve(int testNumber, InputReader in, PrintWriter out) { Point bag = new Point(in.ni(), in.ni()); int n = in.ni(); Point[] arr = new Point[n]; for (int i = 0; i < n; ++i) arr[i] = new Point(in.ni(), in.ni()); int[] dist = new int[n]; for (int i = 0; i < n; ++i) { int dx = arr[i].x - bag.x; int dy = arr[i].y - bag.y; dist[i] = dx * dx + dy * dy; } int[][] d = new int[n][n]; for (int i = 0; i < n; ++i) { for (int j = 0; j < n; ++j) { int dx = arr[i].x - arr[j].x; int dy = arr[i].y - arr[j].y; d[i][j] = dx * dx + dy * dy + dist[i] + dist[j]; } } int lim = (1 << n); int[] dp = new int[lim]; Arrays.fill(dp, Integer.MAX_VALUE); dp[0] = 0; int[] p = new int[lim]; Arrays.fill(p, -1); for (int mask = 0; mask < lim; ++mask) { if (dp[mask] == Integer.MAX_VALUE) continue; int minBit = -1; for (int bit = 0; bit < n; ++bit) { if (checkBit(mask, bit)) continue; if (minBit == -1 || (dist[minBit] > dist[bit])) minBit = bit; } if (minBit == -1) continue; for (int bit = 0; bit < n; ++bit) { if (checkBit(mask, bit)) continue; int newMask = (mask | (1 << minBit) | (1 << bit)); if (dp[newMask] > dp[mask] + d[minBit][bit]) { dp[newMask] = dp[mask] + d[minBit][bit]; p[newMask] = minBit * n + bit; } } } out.println(dp[lim - 1]); int curMask = lim - 1; while (p[curMask] != -1) { out.print("0 "); int first = p[curMask] / n; int second = p[curMask] % n; out.print(first + 1 + " "); curMask ^= (1 << first); if (first != second) { out.print(second + 1 + " "); curMask ^= (1 << second); } } out.println(0); } boolean checkBit(int mask, int bitNumber) { return (mask & (1 << bitNumber)) != 0; } } static class InputReader { BufferedReader br; StringTokenizer st; public InputReader(InputStream inputStream) { br = new BufferedReader(new InputStreamReader(inputStream)); } public String n() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { throw new RuntimeException(); } } return st.nextToken(); } public int ni() { return Integer.parseInt(n()); } } }
np
8_C. Looking for Order
CODEFORCES
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; import java.util.Calendar; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedList; import java.util.PriorityQueue; import java.util.SortedSet; import java.util.Stack; import java.util.StringTokenizer; import java.util.TreeMap; import java.util.TreeSet; /** * # * @author pttrung */ public class D_Edu_Round_35 { public static long MOD = 1000000007; public static void main(String[] args) throws FileNotFoundException { // PrintWriter out = new PrintWriter(new FileOutputStream(new File( // "output.txt"))); PrintWriter out = new PrintWriter(System.out); Scanner in = new Scanner(); int n = in.nextInt(); int[] data = new int[n]; for (int i = 0; i < n; i++) { data[i] = in.nextInt(); } FT tree = new FT(n + 1); int result = 0; for (int i = n - 1; i >= 0; i--) { tree.update(data[i], 1); result += tree.get(data[i] - 1); result %= 2; } int q = in.nextInt(); int[] tmp = new int[n]; for (int i = 0; i < q; i++) { int l = in.nextInt() - 1; int r = in.nextInt() - 1; FT a = new FT(n + 1); int total = r - l + 1; total = total * (total - 1) / 2; total %= 2; // for (int j = r; j >= l; j--) { // tmp[j] = data[j]; // a.update(data[j], 1); // total -= a.get(data[j] - 1); // // total += 2; // // total %= 2; // } // System.out.println("PRE " + result); // System.out.println(Arrays.toString(tmp)); // for (int j = 0; j < (r - l + 1) / 2; j++) { // data[r - j] = tmp[l + j]; // data[l + j] = tmp[r - j]; // } result += total; result %= 2; // System.out.println("AFTER " + result); // System.out.println(Arrays.toString(data)); if (result % 2 == 0) { out.println("even"); } else { out.println("odd"); } } out.close(); } public static int[] KMP(String val) { int i = 0; int j = -1; int[] result = new int[val.length() + 1]; result[0] = -1; while (i < val.length()) { while (j >= 0 && val.charAt(j) != val.charAt(i)) { j = result[j]; } j++; i++; result[i] = j; } return result; } public static boolean nextPer(int[] data) { int i = data.length - 1; while (i > 0 && data[i] < data[i - 1]) { i--; } if (i == 0) { return false; } int j = data.length - 1; while (data[j] < data[i - 1]) { j--; } int temp = data[i - 1]; data[i - 1] = data[j]; data[j] = temp; Arrays.sort(data, i, data.length); return true; } public static int digit(long n) { int result = 0; while (n > 0) { n /= 10; result++; } return result; } public static double dist(long a, long b, long x, long y) { double val = (b - a) * (b - a) + (x - y) * (x - y); val = Math.sqrt(val); double other = x * x + a * a; other = Math.sqrt(other); return val + other; } public static class Point implements Comparable<Point> { int x, y; public Point(int start, int end) { this.x = start; this.y = end; } @Override public int hashCode() { int hash = 5; hash = 47 * hash + this.x; hash = 47 * hash + this.y; return hash; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Point other = (Point) obj; if (this.x != other.x) { return false; } if (this.y != other.y) { return false; } return true; } @Override public int compareTo(Point o) { return Integer.compare(x, o.x); } } public static class FT { int[] data; FT(int n) { data = new int[n]; } public void update(int index, int value) { while (index < data.length) { data[index] += value; data[index] %= 2; index += (index & (-index)); } } public int get(int index) { int result = 0; while (index > 0) { result += data[index]; result %= 2; index -= (index & (-index)); } return result; } } public static long gcd(long a, long b) { if (b == 0) { return a; } return gcd(b, a % b); } public static long pow(long a, long b, long MOD) { if (b == 0) { return 1; } if (b == 1) { return a; } long val = pow(a, b / 2, MOD); if (b % 2 == 0) { return val * val % MOD; } else { return val * (val * a % MOD) % MOD; } } static class Scanner { BufferedReader br; StringTokenizer st; public Scanner() throws FileNotFoundException { // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true)); br = new BufferedReader(new InputStreamReader(System.in)); // br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt")))); } public String next() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (Exception e) { throw new RuntimeException(); } } return st.nextToken(); } public long nextLong() { return Long.parseLong(next()); } public int nextInt() { return Integer.parseInt(next()); } public double nextDouble() { return Double.parseDouble(next()); } public String nextLine() { st = null; try { return br.readLine(); } catch (Exception e) { throw new RuntimeException(); } } public boolean endLine() { try { String next = br.readLine(); while (next != null && next.trim().isEmpty()) { next = br.readLine(); } if (next == null) { return true; } st = new StringTokenizer(next); return st.hasMoreTokens(); } catch (Exception e) { throw new RuntimeException(); } } } }
quadratic
911_D. Inversion Counting
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StreamTokenizer; import java.util.Arrays; import java.util.Locale; public class E16 { static StreamTokenizer in; static PrintWriter out; static int nextInt() throws IOException { in.nextToken(); return (int)in.nval; } static double nextDouble() throws IOException { in.nextToken(); return in.nval; } static String nextString() throws IOException { in.nextToken(); return in.sval; } public static void main(String[] args) throws IOException { in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); out = new PrintWriter(System.out); n = nextInt(); t = 1 << n; m = new double[n][n]; for (int i = 0; i < n; i++) for (int j = 0; j < n; j++) m[i][j] = nextDouble(); memo = new double[t]; Arrays.fill(memo, Double.POSITIVE_INFINITY); for (int i = 0; i < n; i++) out.print(String.format(Locale.US, "%.6f", solve(1 << i)) + " "); out.println(); out.flush(); } static int n, t; static double[][] m; static double[] memo; static double solve(int mask) { if (memo[mask] != Double.POSITIVE_INFINITY) return memo[mask]; if (mask == t-1) return memo[mask] = 1; int k = Integer.bitCount(mask); k = (k+1)*k/2; double res = 0; for (int i = 0; i < n; i++) if ((mask&(1 << i)) != 0) for (int j = 0; j < n; j++) if ((mask&(1 << j)) == 0) res += m[i][j]*solve(mask|(1 << j)); return memo[mask] = res/k; } }
np
16_E. Fish
CODEFORCES
import java.io.*; import java.util.*; public class Template implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); void init() throws FileNotFoundException { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); } String readString() throws IOException { while (!tok.hasMoreTokens()) { try { tok = new StringTokenizer(in.readLine(), " :"); } catch (Exception e) { return null; } } return tok.nextToken(); } int readInt() throws IOException { return Integer.parseInt(readString()); } int[] readIntArray(int size) throws IOException { int[] res = new int[size]; for (int i = 0; i < size; i++) { res[i] = readInt(); } return res; } long readLong() throws IOException { return Long.parseLong(readString()); } double readDouble() throws IOException { return Double.parseDouble(readString()); } <T> List<T>[] createGraphList(int size) { List<T>[] list = new List[size]; for (int i = 0; i < size; i++) { list[i] = new ArrayList<>(); } return list; } public static void main(String[] args) { new Thread(null, new Template(), "", 1l * 200 * 1024 * 1024).start(); } long timeBegin, timeEnd; void time() { timeEnd = System.currentTimeMillis(); System.err.println("Time = " + (timeEnd - timeBegin)); } long memoryTotal, memoryFree; void memory() { memoryFree = Runtime.getRuntime().freeMemory(); System.err.println("Memory = " + ((memoryTotal - memoryFree) >> 10) + " KB"); } public void run() { try { timeBegin = System.currentTimeMillis(); memoryTotal = Runtime.getRuntime().freeMemory(); init(); solve(); out.close(); if (System.getProperty("ONLINE_JUDGE") == null) { time(); memory(); } } catch (Exception e) { e.printStackTrace(); System.exit(-1); } } int fx = -1; int sx = -1; int fy = -1; int sy = -1; int query(int x1, int y1, int x2, int y2) throws IOException { out.println("? " + x1 + " " + y1 + " " + x2 + " " + y2); out.flush(); int res = readInt(); if (fx >= x1 && sx <= x2 && fy >= y1 && sy <= y2) res--; return res; } int[] bs(int n) throws IOException { int l = 1; int r = n; int lx = 0, rx = 0, ly = 0, ry = 0; while (l <= r) { int mid = (l + r) >> 1; if (query(1, 1, mid, n) > 0) { rx = mid; r = mid - 1; } else { l = mid + 1; } } l = 1; r = rx; while (l <= r) { int mid = (l + r) >> 1; if (query(mid, 1, rx, n) > 0) { lx = mid; l = mid + 1; } else { r = mid - 1; } } l = 1; r = n; while (l <= r) { int mid = (l + r) >> 1; if (query(lx, mid, rx, n) > 0) { ly = mid; l = mid + 1; } else { r = mid - 1; } } l = ly; r = n; while (l <= r) { int mid = (l + r) >> 1; if (query(lx, ly, rx, mid) > 0) { ry = mid; r = mid - 1; } else { l = mid + 1; } } fx = lx; sx = rx; fy = ly; sy = ry; return new int[] {lx, ly, rx, ry}; } void solve() throws IOException { int n = readInt(); int[] a = bs(n); int[] b = bs(n); out.print("! "); for (int i : a) out.print(i + " "); for (int i : b) out.print(i + " "); } }
logn
713_B. Searching Rectangles
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.PriorityQueue; import java.util.Random; import java.util.StringTokenizer; import java.util.TreeMap; import java.util.TreeSet; @SuppressWarnings("unused") public class Solution{ static long mod = -1; static long[] fact, invfact, pow; static long[][] C; static long[][] dp; static final int N = 405; static int n; public static void main(String[] args) throws IOException { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int tt = 1; outer: while(tt-->0) { n = fs.nextInt(); mod = fs.nextLong(); dp = new long[N][N]; precompute(); dp[0][0] = 1; for(int i=0;i<n;i++) { for(int j=0;j<=i;j++) { for(int k=1;i+k<=n;k++) { dp[i+k+1][j+k] += (((dp[i][j]*pow[k-1])%mod)*C[j+k][k])%mod; dp[i+k+1][j+k] %= mod; } } } long ans = 0; for(int i=0;i<=n;i++) { ans = (ans + dp[n+1][i])%mod; } out.println(ans); } out.close(); } static void precompute() { fact = new long[N]; invfact = new long[N]; C = new long[N][N]; pow = new long[N]; fact[0] = 1; for(int i=1;i<=n;i++) fact[i] = (fact[i-1]*i)%mod; invfact[n] = inv(fact[n]); for(int i=n-1;i>=0;i--) invfact[i] = (invfact[i+1]*(i+1))%mod; pow[0] = 1; for(int i=1;i<=n;i++) pow[i] = (pow[i-1]*2)%mod; for(int i=1;i<=n;i++) { for(int j=0;j<=i;j++) { if(j==0 || j==i) C[i][j] = 1; else C[i][j] = (C[i-1][j-1] + C[i-1][j])%mod; } } } static long exp(long a, long n) { long res = 1; while(n>0) { if((n&1)==1) res = (res*a)%mod; a = (a*a)%mod; n = n>>1; } return res; } static long inv(long n) { return exp(n, mod-2); } static final Random random=new Random(); static <T> void shuffle(T[] arr) { int n = arr.length; for(int i=0;i<n;i++ ) { int k = random.nextInt(n); T temp = arr[k]; arr[k] = arr[i]; arr[i] = temp; } } static void ruffleSort(int[] a) { int n=a.length;//shuffle, then sort for (int i=0; i<n; i++) { int oi=random.nextInt(n); int temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } static void ruffleSort(long[] a) { int n=a.length;//shuffle, then sort for (int i=0; i<n; i++) { int oi=random.nextInt(n); long temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } static void reverse(int[] arr, int l, int r) { for(int i=l;i<l+(r-l)/2;i++){ int temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp; } } static void reverse(long[] arr, int l, int r) { for(int i=l;i<l+(r-l)/2;i++){ long temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp; } } static <T> void reverse(T[] arr, int l, int r) { for(int i=l;i<l+(r-l)/2;i++) { T temp = arr[i]; arr[i] = arr[r-i+l-1]; arr[r-i+l-1] = temp; } } static class FastScanner{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public String next(){ while(!st.hasMoreElements()){ try{ st = new StringTokenizer(br.readLine()); } catch(IOException e){ e.printStackTrace(); } } return st.nextToken(); } public String nextLine() throws IOException { return br.readLine(); } public int nextInt(){ return Integer.parseInt(next()); } public int[] readArray(int n){ int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = nextInt(); return a; } public long nextLong() { return Long.parseLong(next()); } public char nextChar() { return next().toCharArray()[0]; } } }
cubic
1515_E. Phoenix and Computers
CODEFORCES
//package codeforces.contests.cf159; import java.io.*; import java.util.Arrays; public class ProblemA { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); PrintWriter writer = new PrintWriter(new OutputStreamWriter(System.out)); int[] readInts() throws IOException { String[] strings = reader.readLine().split(" "); int[] ints = new int[strings.length]; for(int i = 0; i < ints.length; i++) { ints[i] = Integer.parseInt(strings[i]); } return ints; } void solve() throws IOException { int[] tt = readInts(); int n = tt[0]; int m = tt[1]; int k = tt[2]; int[] a = readInts(); Arrays.sort(a); for(int i = 0, j = a.length - 1; i < j; i++, j--) { int t = a[i]; a[i] = a[j]; a[j] = t; } int ix = 0; while(k < m && ix < n) { k += a[ix++] - 1; } if(k < m) { writer.println(-1); } else { writer.println(ix); } writer.flush(); } public static void main(String[] args) throws IOException { new ProblemA().solve(); } }
nlogn
257_A. Sockets
CODEFORCES
//make sure to make new file! import java.io.*; import java.util.*; public class B713{ public static BufferedReader f; public static PrintWriter out; public static void main(String[] args)throws IOException{ f = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); int n = Integer.parseInt(f.readLine()); int l; int r; int mid; int ans; l = 1; r = n; ans = -1; //see if you can draw vertical line between them while(l <= r){ mid = l + (r-l)/2; if(mid == n) break; int il = query(1,1,n,mid); int ir = query(1,mid+1,n,n); if(il == 1 && ir == 1){ ans = mid; break; } if(il > ir){ r = mid-1; } else { l = mid+1; } } int x11 = -1; int y11 = -1; int x12 = -1; int y12 = -1; int x21 = -1; int y21 = -1; int x22 = -1; int y22 = -1; if(ans == -1){ //find horizontal line l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int il = query(1,1,mid,n); int ir = query(mid+1,1,n,n); if(il == 1 && ir == 1){ ans = mid; break; } if(il > ir){ r = mid-1; } else { l = mid+1; } } int bar = ans; //find top line of top block l = 1; r = bar; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(mid,1,bar,n); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } x11 = ans; //find bottom line of top block l = 1; r = bar; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,1,mid,n); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } x12 = ans; //find left of top block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,mid,bar,n); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } y11 = ans; //find right of top block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,1,bar,mid); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } y12 = ans; //find top line of bottom block l = bar+1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(mid,1,n,n); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } x21 = ans; //find bottom line of bottom block l = bar+1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(bar+1,1,mid,n); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } x22 = ans; //find left of bottom block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(bar+1,mid,n,n); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } y21 = ans; //find right of bottom block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(bar+1,1,n,mid); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } y22 = ans; } else { //ans is the vertical line between int bar = ans; //find left line of left block l = 1; r = bar; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,mid,n,bar); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } y11 = ans; //find right line of left block l = 1; r = bar; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,1,n,mid); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } y12 = ans; //find top of left block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(mid,1,n,bar); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } x11 = ans; //find bottom of left block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,1,mid,bar); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } x12 = ans; //find left line of right block l = bar+1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,mid,n,n); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } y21 = ans; //find right line of right block l = bar+1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,bar+1,n,mid); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } y22 = ans; //find top of right block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(mid,bar+1,n,n); if(i == 1){ ans = mid; l = mid+1; } else { r = mid-1; } } x21 = ans; //find bottom of right block l = 1; r = n; ans = -1; while(l <= r){ mid = l + (r-l)/2; int i = query(1,bar+1,mid,n); if(i == 1){ ans = mid; r = mid-1; } else { l = mid+1; } } x22 = ans; } out.println("! " + x11 + " " + y11 + " " + x12 + " " + y12 + " " + x21 + " " + y21 + " " + x22 + " " + y22); out.close(); } public static int query(int a,int b, int c, int d)throws IOException{ out.println("? " + a + " " + b + " " + c + " " + d); out.flush(); return Integer.parseInt(f.readLine()); } }
logn
713_B. Searching Rectangles
CODEFORCES
import java.io.*; import java.util.*; public class A { int n, m, k; int[] a; void run()throws IOException{ // BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); Scanner sc = new Scanner(new InputStreamReader(System.in)); n = sc.nextInt(); m = sc.nextInt(); k = sc.nextInt(); a = new int[n]; for(int i=0;i<n; i++) a[i] = sc.nextInt(); Arrays.sort(a); if(m<=k){ System.out.println(0); return; } int cnt = k; int ind = a.length-1; int ret = 0; while(cnt<m && ind>=0){ cnt += a[ind]-1; --ind; ret++; } if(cnt>=m) System.out.println(ret); else System.out.println(-1); } public static void main(String[] args)throws IOException { new A().run(); } }
nlogn
257_A. Sockets
CODEFORCES
import java.io.IOException; import java.io.InputStream; import java.util.InputMismatchException; public class Main { static long MOD = (long) 1e9 + 7; static long[][] identity = {{1, 0}, {0, 1}}; public static void main(String[] args) { FastScanner input = new FastScanner(System.in); long x = input.nextLong(); long k = input.nextLong(); long[][] matrix = { {2, MOD - 1}, {0, 1} }; if (x == 0) System.out.println(0); else if (k == 0) { System.out.println((x * 2) % MOD); } else { x %= MOD; matrix = matrixexpo(k, matrix); long low = (x * matrix[0][0] + matrix[0][1]) % MOD; long hi = x * mathpow(k, 2) % MOD; System.out.println((low + hi) % MOD); } } static long mathpow(long k, long x) { if (k == 0) return 1L; else return mathpow(k / 2, (x * x) % MOD) * (k % 2 == 1 ? x : 1) % MOD; } static long[][] matrixexpo(long k, long[][] matrix) { if (k == 0) return identity; if (k % 2 == 0) return matrixexpo(k / 2, multiply(matrix, matrix)); else return multiply(matrix, matrixexpo(k / 2, multiply(matrix, matrix))); } static long[][] multiply(long[][] arr, long[][] brr) { int n = arr.length, m = arr[0].length, p = brr[0].length; long[][] product = new long[n][p]; for (int i = 0; i < n; i++) for (int j = 0; j < p; j++) for (int k = 0; k < m; k++) product[i][j] = (product[i][j] + arr[i][k] * brr[k][j]) % MOD; return product; } // Matt Fontaine's Fast IO static class FastScanner { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public FastScanner(InputStream stream) { this.stream = stream; } int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } boolean isSpaceChar(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } boolean isEndline(int c) { return c == '\n' || c == '\r' || c == -1; } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String next() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } String nextLine() { int c = read(); while (isEndline(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isEndline(c)); return res.toString(); } } }
logn
992_C. Nastya and a Wardrobe
CODEFORCES
import java.io.*; import java.util.*; public class A implements Runnable { public static void main(String[] args) { new A().run(); } class FastScanner { BufferedReader br; StringTokenizer st; boolean eof; String buf; public FastScanner(String fileName) throws FileNotFoundException { br = new BufferedReader(new FileReader(fileName)); nextToken(); } public FastScanner(InputStream stream) { br = new BufferedReader(new InputStreamReader(stream)); nextToken(); } String nextToken() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (Exception e) { eof = true; break; } } String ret = buf; buf = eof ? "-1" : st.nextToken(); return ret; } int nextInt() { return Integer.parseInt(nextToken()); } long nextLong() { return Long.parseLong(nextToken()); } double nextDouble() { return Double.parseDouble(nextToken()); } void close() { try { br.close(); } catch (Exception e) { } } boolean isEOF() { return eof; } } FastScanner sc; PrintWriter out; public void run() { Locale.setDefault(Locale.US); try { sc = new FastScanner(System.in); out = new PrintWriter(System.out); solve(); sc.close(); out.close(); } catch (Throwable e) { e.printStackTrace(); System.exit(1); } } int nextInt() { return sc.nextInt(); } String nextToken() { return sc.nextToken(); } long nextLong() { return sc.nextLong(); } double nextDouble() { return sc.nextDouble(); } class House { int x, t; public House(int x, int t) { this.x = x; this.t = t; } } void solve() { int n = nextInt(); int t = nextInt(); House[] h = new House[n]; for (int i = 0; i < n; i++) { h[i] = new House(nextInt(), nextInt()); } Arrays.sort(h, new Comparator<House>() { @Override public int compare(House o1, House o2) { return o1.x < o2.x ? -1 : o1.x > o2.x ? 1 : 0; } }); int ans = 0; for (int i = 0; i < n; i++) { if (i == 0 || (h[i].x - h[i - 1].x) * 2 - h[i].t - h[i - 1].t >= 2 * t) { ++ans; } if (i == n - 1 || (h[i + 1].x - h[i].x) * 2 - h[i + 1].t - h[i].t > 2 * t) { ++ans; } } out.println(ans); } }
nlogn
15_A. Cottage Village
CODEFORCES
import java.io.*; import java.util.*; public class ReallyBigNumbers817c { static long sd(String s) { long c = 0; for (int i = 0; i < s.length(); i++) { c += s.charAt(i); } return c - s.length() * 0x30; } public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(in.readLine()); long n = Long.parseLong(st.nextToken()); long s = Long.parseLong(st.nextToken()); long i = (s / 10 + 1) * 10; if (n < 10 || n - sd(n + "") < s) { System.out.println(0); return; } while (!(i - sd(""+i) >= s)) { i += 10; } System.out.println(n - i + 1); } }
logn
817_C. Really Big Numbers
CODEFORCES
import java.io.*; public class D7182 { public static void main(String[] args) throws IOException { init_io(); int N = nint(), M = nint(), K = nint(); if (K % 2 == 0) { int[][][] grid = new int[K+1][N][M]; int[][][] edges = new int[4][N][M]; for (int i = 0; i < N; i++) { for (int j = 0; j < M-1; j++) { edges[0][i][j] = edges[2][i][j+1] = nint(); } } for (int i = 0; i < N-1; i++) { for (int j = 0; j < M; j++) { edges[1][i][j] = edges[3][i+1][j] = nint(); } } for (int k = 1; k <= K/2; k++) { for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { int min = Integer.MAX_VALUE; if (i != N-1) { min = Math.min(min, grid[k-1][i+1][j] + edges[1][i][j]); } if (j != M-1) { min = Math.min(min, grid[k-1][i][j+1] + edges[0][i][j]); } if (i != 0) { min = Math.min(min, grid[k-1][i-1][j] + edges[3][i][j]); } if (j != 0) { min = Math.min(min, grid[k-1][i][j-1] + edges[2][i][j]); } grid[k][i][j] = min; } } } for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { out.print(grid[K/2][i][j]*2 + " "); } out.println(); } } else { for (int i = 0; i < N; i++) { for (int j = 0; j < M; j++) { out.print(-1 + " "); } out.println(); } } out.close(); } static StreamTokenizer in; static PrintWriter out; static BufferedReader br; static int nint() throws IOException { in.nextToken(); return (int) in.nval; } static void init_io() throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); in = new StreamTokenizer(br); out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); } }
cubic
1517_D. Explorer Space
CODEFORCES
import java.util.*; public class cf112e { static int n,m,s; static int[][][] memo; public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); m = in.nextInt(); if(n > m) { int tmp = n; n = m; m = tmp; } s = (1<<n); memo = new int[s][s][m]; for(int i=0; i<s; i++) for(int j=0; j<s; j++) Arrays.fill(memo[i][j], -1); int ret = go(0,0,0); System.out.println(n*m - ret); } static int go(int last, int trans, int r) { if(r==m) { if(trans == 0) return 0; return 100; } if(memo[last][trans][r] != -1) return memo[last][trans][r]; int best = 100; for(int crnt = 0; crnt < s; crnt++) { if((trans & ~crnt) != 0) continue; //certain ones have to be here for(int pass = 0; pass < s; pass++) { int tmp = ((1<<n)-1) & ~last; //move back the ones you can if((pass & ~tmp) != 0) continue; //certain ones have to move on tmp = tmp & ~pass; //find which ones stay boolean fail = false; for(int k=0; k<n; k++) //make sure that the ones that stay if(isSet(tmp,k) && !(isSet(crnt,k-1) || isSet(crnt,k) || isSet(crnt,k+1))) fail = true; if(fail) continue; best = Math.min(best, Integer.bitCount(crnt) + go(crnt,pass,r+1)); } } return memo[last][trans][r] = best; } static boolean isSet(int x, int p) { if(p < 0 || p >= n) return false; return (x & (1<<p)) != 0; } }
np
112_E. Petya and Spiders
CODEFORCES
import java.io.*; import java.util.*; public class Main { Scanner cin = new Scanner(new BufferedInputStream(System.in)); long n; long maxlcm; void run(){ n = cin.nextInt(); if(n == 1 || n ==2) maxlcm = n; else if(n >= 3){ if(n % 2 != 0){ maxlcm = n * (n-1) * (n - 2); } else if(n%3 != 0) maxlcm = n * (n - 1) * (n - 3); else maxlcm = (n - 1) * (n - 2) * (n - 3); } System.out.println(maxlcm); } public static void main(String[] args) { new Main().run(); } }
constant
235_A. LCM Challenge
CODEFORCES
import java.io.BufferedReader; import java.io.InputStreamReader; import java.text.DecimalFormat; import java.util.StringTokenizer; public class Main { static int N; static int K; static int A; static double dl[]; static int base[]; static int needed; static int b[] = new int[N]; static int l[] = new int[N]; static double best; static void printLevels() { int i; for (i=0;i<N;i++) { System.out.println(i+" "+dl[i]); } } static void giveCandies(int i, int remaining) { if (remaining == 0) { check(); return; } if (i == N) { check(); return; } int j; double ns; double orig = dl[i]; for (j=0;j<=remaining;j++) { ns = orig+j*0.1; if (ns <= 1.0) { dl[i] = ns; giveCandies(i+1, remaining-j); dl[i] = orig; } else { break; } } } static void check() { int i,j,k; double res = 0.0; int total; double prob; int max = 1<<N; double sumg, sumb; double pk, da = (double)A; for (k=0;k<max;k++) { prob = 1.0; total = 0; sumg = 0; sumb = 0; for (i=0;i<N;i++) { if ((base[i]&k) > 0) { prob *= dl[i]; total++; sumg += b[i]; } else { prob *= (1.0-dl[i]); sumb += b[i]; } } if (total >= needed) { // needed number of senators voted positivelly res += prob; } else { pk = da/(da+sumb); res += prob*pk; } } best = Math.max(best, res); } public static void main(String[] args) throws Exception { int i,j,k; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.nextToken()); K = Integer.parseInt(st.nextToken()); A = Integer.parseInt(st.nextToken()); needed = N/2+1; b = new int[N]; l = new int[N]; dl = new double[N]; for (i=0;i<N;i++) { st = new StringTokenizer(br.readLine()); b[i] = Integer.parseInt(st.nextToken()); l[i] = Integer.parseInt(st.nextToken()); dl[i] = ((double)l[i])/100.0; } base = new int[8]; base[0] = 1; for (i=1;i<N;i++) { base[i] = base[i-1]*2; } best = 0.0; giveCandies(0, K); DecimalFormat df = new DecimalFormat("0.0000000000"); String rs = df.format(best); String mrs = ""; for (i=0;i<rs.length();i++) { if (rs.charAt(i) == ',') { mrs += '.'; } else { mrs += rs.charAt(i); } } System.out.println(mrs); } }
np
105_B. Dark Assembly
CODEFORCES
import java.io.*; import java.util.*; public class Example { BufferedReader in; PrintWriter out; StringTokenizer st; String next() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(in.readLine()); } catch (Exception e) { } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } public void run() throws Exception { //in = new BufferedReader(new FileReader("input.txt")); //out = new PrintWriter(new FileWriter("output.txt")); in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); solve(); out.flush(); out.close(); in.close(); } long n, x, y, c; boolean check(long z) { long res = 1 + 2 * z * (z + 1); long bx1 = z - x + 1; long by1 = z - y + 1; long bxn = z - n + x; long byn = z - n + y; if (bx1 > 0) { res -= bx1 * bx1; } if (bxn > 0) { res -= bxn * bxn; } if (by1 > 0) { res -= by1 * by1; } if (byn > 0) { res -= byn * byn; } if (z > x + y - 1) { long m = z - x - y + 1; res += m * (m + 1) / 2; } if (z > x + n - y) { long m = z - x - n + y; res += m * (m + 1) / 2; } if (z > n - x + y) { long m = z - n - y + x; res += m * (m + 1) / 2; } if (z > n - x + n - y + 1) { long m = z - 2 * n + x + y - 1; res += m * (m + 1) / 2; } return res >= c; } public void solve() throws Exception { n = nextLong(); x = nextLong(); y = nextLong(); c = nextLong(); long l = 0; long r = 2 * n; while (r > l) { long mid = (r + l) / 2; if (check(mid)) { r = mid; } else { l = mid + 1; } } out.println(r); } public static void main(String[] args) throws Exception { new Example().run(); } }
logn
256_B. Mr. Bender and Square
CODEFORCES
import java.util.Scanner; public class CF489_C { static long mod = 1000000007; public static void main(String[] args) { Scanner s = new Scanner(System.in); long x = s.nextLong(), k = s.nextLong(); if (x == 0) { System.out.println(0); return; } long max = x % mod; long temp = power(2, k, mod); temp %= mod; max = (max % mod) * (temp % mod); max %= mod; long min = max % mod; min = mod(min - (temp - 1)); min %= mod; long num = mod(max - min + 1); long n = num % mod; n = (n % mod) * (min % mod + max % mod); n = n % mod; n %= mod; long ans = n % mod * modInverse(num, mod); System.out.println(ans % mod); } static long modInverse(long a, long m) { long m0 = m; long y = 0, x = 1; if (m == 1) return 0; while (a > 1) { // q is quotient long q = a / m; long t = m; // m is remainder now, process same as // Euclid's algo m = a % m; a = t; t = y; // Update y and x y = x - q * y; x = t; } // Make x positive if (x < 0) x += m0; return x; } static long mod(long val) { val %= mod; if (val < 0) val += mod; return val; } static long power(long x, long y, long p) { // Initialize result long res = 1; // Update x if it is more // than or equal to p x = x % p; while (y > 0) { // If y is odd, multiply x // with result if ((y & 1) == 1) res = (res * x) % p; // y must be even now // y = y / 2 y = y >> 1; x = (x * x) % p; } return res; } }
logn
992_C. Nastya and a Wardrobe
CODEFORCES
import java.util.Arrays; import java.util.Scanner; public class C { static boolean[][] matrix; static long[][] dp; static int n; static int m; public static void main(String[] args) { Scanner s = new Scanner(System.in); n = s.nextInt(); m = s.nextInt(); matrix = new boolean[n][n]; for (int i=0; i<m; ++i) { int v1 = s.nextInt()-1; int v2 = s.nextInt()-1; matrix[v1][v2] = true; matrix[v2][v1] = true; } dp = new long[n][1<<n+1]; for (int i=0; i<n; ++i) Arrays.fill(dp[i], -1); long res = 0; for (int i=0; i<n; ++i) res += calc(i, i, (1<<i), 1); System.out.println(res/2); } public static long calc(int h, int c, int m, int len) { if (dp[c][m] != -1) return dp[c][m]; long ret = 0; if (len > 2 && matrix[c][h]) ret = 1; for (int i=h+1; i<n; ++i) if ((m & (1<<i)) == 0 && matrix[c][i]) ret += calc(h, i, m | (1<<i), len + 1); return dp[c][m] = ret; } }
np
11_D. A Simple Task
CODEFORCES
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { static class Task { int NN = 1000006; int MOD = 998244353; int INF = 2000000000; long INFINITY = 1000000000000000000L; long [][] a; long [][] w, w1; long [][] dp; int countBit(int num) { int ret = 0; while(num > 0) { if((num&1)!=0) ++ret; num >>= 1; } return ret; } long rec(int at, int mask, int n, int start) { long ans = -INFINITY; if(dp[at][mask] != -1) return dp[at][mask]; if(countBit(mask) == n) { return dp[at][mask] = w1[start][at]; } for(int i=0;i < n;++i) { if(((mask>>i)&1)==0) { ans = Math.max(ans, Math.min(w[at][i], rec(i, mask | (1<<i), n, start))); } } return dp[at][mask] = ans; } public void solve(InputReader in, PrintWriter out) { int n = in.nextInt(), m = in.nextInt(); dp = new long[n][1<<n]; a = new long[n][m]; w = new long[n][n]; w1 = new long[n][n]; for(int i=0;i<n;++i) { for(int j=0;j<m;++j) { a[i][j] = in.nextLong(); } } for(int i=0;i<n;++i) { for(int j=0;j<n;++j) { w[i][j] = INFINITY; if(i == j) continue; for(int k=0;k<m;++k) { w[i][j] = Math.min(w[i][j], Math.abs(a[j][k] - a[i][k])); } } } for(int i=0;i<n;++i) { for(int j=0;j<n;++j) { w1[i][j] = INFINITY; for(int k=1;k<m;++k) { w1[i][j] = Math.min(w1[i][j], Math.abs(a[i][k] - a[j][k - 1])); } } } long ans = 0; for(int start = 0;start < n;++start) { for(int i=0;i<n;++i) { for(int j=0;j<(1<<n);++j) dp[i][j] = -1; } ans = Math.max(ans, rec(start, 1<<start, n, start)); } out.println(ans); } class Pair { Integer first, second; public Pair() { } public Pair(int first, int second) { this.first = first; this.second = second; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getOuterType().hashCode(); result = prime * result + first; result = prime * result + second; return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Pair other = (Pair) obj; if (!getOuterType().equals(other.getOuterType())) return false; if (first != other.first) return false; if (second != other.second) return false; return true; } private Task getOuterType() { return Task.this; } } } static void prepareIO(boolean isFileIO) { Task solver = new Task(); // Standard IO if(!isFileIO) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); solver.solve(in, out); out.close(); } // File IO else { String IPfilePath = System.getProperty("user.home") + "/Downloads/ip.in"; String OPfilePath = System.getProperty("user.home") + "/Downloads/op.out"; InputReader fin = new InputReader(IPfilePath); PrintWriter fout = null; try { fout = new PrintWriter(new File(OPfilePath)); } catch (FileNotFoundException e) { e.printStackTrace(); } solver.solve(fin, fout); fout.close(); } } public static void main(String[] args) { prepareIO(false); } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public InputReader(String filePath) { File file = new File(filePath); try { reader = new BufferedReader(new FileReader(file)); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); } tokenizer = null; } public String nextLine() { String str = ""; try { str = reader.readLine(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return str; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } } }
np
1102_F. Elongated Matrix
CODEFORCES
import java.io.*; import java.util.*; public class Mai { public static void main(String[] args) throws IOException{ Scanner cin = new Scanner(System.in); int t, n, m; t = cin.nextInt(); while(t > 0) { t--; int sum = 0; n = cin.nextInt(); m = cin.nextInt(); while(n > 0 && m > 0) { if(n < m) { int k = n; n = m; m = k; } sum += n / m; n %= m; } System.out.println(sum); } } }
constant
267_A. Subtractions
CODEFORCES
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) throws Exception { MyReader reader = new MyReader(System.in); // MyReader reader = new MyReader(new FileInputStream("input.txt")); MyWriter writer = new MyWriter(System.out); new Solution().run(reader, writer); writer.close(); } private void run(MyReader reader, MyWriter writer) throws IOException, InterruptedException { int n = reader.nextInt(); int[] a = reader.nextIntArray(n); boolean b = false; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (a[i] > a[j]) { b = !b; } } } int m = reader.nextInt(); for (int i = 0; i < m; i++) { int l = reader.nextInt(); int r = reader.nextInt(); int d = r - l + 1; if (d * (d - 1) / 2 % 2 == 1) { b = !b; } writer.println(b ? "odd" : "even"); } } static class MyReader { final BufferedInputStream in; final int bufSize = 1 << 16; final byte buf[] = new byte[bufSize]; int i = bufSize; int k = bufSize; boolean end = false; final StringBuilder str = new StringBuilder(); MyReader(InputStream in) { this.in = new BufferedInputStream(in, bufSize); } int nextInt() throws IOException { return (int) nextLong(); } int[] nextIntArray(int n) throws IOException { int[] m = new int[n]; for (int i = 0; i < n; i++) { m[i] = nextInt(); } return m; } int[][] nextIntMatrix(int n, int m) throws IOException { int[][] a = new int[n][0]; for (int j = 0; j < n; j++) { a[j] = nextIntArray(m); } return a; } long nextLong() throws IOException { int c; long x = 0; boolean sign = true; while ((c = nextChar()) <= 32) ; if (c == '-') { sign = false; c = nextChar(); } if (c == '+') { c = nextChar(); } while (c >= '0') { x = x * 10 + (c - '0'); c = nextChar(); } return sign ? x : -x; } long[] nextLongArray(int n) throws IOException { long[] m = new long[n]; for (int i = 0; i < n; i++) { m[i] = nextLong(); } return m; } int nextChar() throws IOException { if (i == k) { k = in.read(buf, 0, bufSize); i = 0; } return i >= k ? -1 : buf[i++]; } String nextString() throws IOException { if (end) { return null; } str.setLength(0); int c; while ((c = nextChar()) <= 32 && c != -1) ; if (c == -1) { end = true; return null; } while (c > 32) { str.append((char) c); c = nextChar(); } return str.toString(); } String nextLine() throws IOException { if (end) { return null; } str.setLength(0); int c = nextChar(); while (c != '\n' && c != '\r' && c != -1) { str.append((char) c); c = nextChar(); } if (c == -1) { end = true; if (str.length() == 0) { return null; } } if (c == '\r') { nextChar(); } return str.toString(); } char[] nextCharArray() throws IOException { return nextString().toCharArray(); } char[][] nextCharMatrix(int n) throws IOException { char[][] a = new char[n][0]; for (int i = 0; i < n; i++) { a[i] = nextCharArray(); } return a; } } static class MyWriter { final BufferedOutputStream out; final int bufSize = 1 << 16; final byte buf[] = new byte[bufSize]; int i = 0; final byte c[] = new byte[30]; static final String newLine = System.getProperty("line.separator"); MyWriter(OutputStream out) { this.out = new BufferedOutputStream(out, bufSize); } void print(long x) throws IOException { int j = 0; if (i + 30 >= bufSize) { flush(); } if (x < 0) { buf[i++] = (byte) ('-'); x = -x; } while (j == 0 || x != 0) { c[j++] = (byte) (x % 10 + '0'); x /= 10; } while (j-- > 0) buf[i++] = c[j]; } void print(int[] m) throws IOException { for (int a : m) { print(a); print(' '); } } void print(long[] m) throws IOException { for (long a : m) { print(a); print(' '); } } void print(String s) throws IOException { for (int i = 0; i < s.length(); i++) { print(s.charAt(i)); } } void print(char x) throws IOException { if (i == bufSize) { flush(); } buf[i++] = (byte) x; } void print(char[] m) throws IOException { for (char c : m) { print(c); } } void println(String s) throws IOException { print(s); println(); } void println() throws IOException { print(newLine); } void flush() throws IOException { out.write(buf, 0, i); out.flush(); i = 0; } void close() throws IOException { flush(); out.close(); } } }
quadratic
911_D. Inversion Counting
CODEFORCES
import java.io.*; import java.util.*; public class C { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = Long.parseLong(in.next()); long s = Long.parseLong(in.next()); if(!check(n, s)){ System.out.println(0); } else { long min = 1; long max = n; while(min != max) { long mid = (min + max) / 2; if(check(mid, s)) { max = mid; } else { min = mid + 1; } } //System.out.println("found: " + min); System.out.println((n - min + 1)); } } public static boolean check(long x, long s) { if(x - sumd(x) < s) { return false; } else { return true; } } public static long sumd(long x) { long sum = 0; while(x != 0) { sum += x % 10; x /= 10; } return sum; } }
logn
817_C. Really Big Numbers
CODEFORCES
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.Arrays; import java.util.StringTokenizer; public class B { static StringTokenizer st; static BufferedReader br; static PrintWriter pw; public static void main(String[] args) throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int n = nextInt(); int left = 0, right = n; int x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0, x4 = 0, y4 = 0; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+1+" "+1+" "+mid+" "+n); int ans = nextInt(); if (ans==2) right = mid; else left = mid; } x4 = right; left = 0; right = n; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+1+" "+1+" "+mid+" "+n); int ans = nextInt(); if (ans >= 1) right = mid; else left = mid; } x2 = right; left = 1; right = n+1; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+mid+" "+1+" "+n+" "+n); int ans = nextInt(); if (ans >= 1) left = mid; else right = mid; } x3 = left; left = 1; right = n+1; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+mid+" "+1+" "+n+" "+n); int ans = nextInt(); if (ans >= 2) left = mid; else right = mid; } x1 = left; left = 0; right = n; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+1+" "+1+" "+n+" "+mid); int ans = nextInt(); if (ans>=2) right = mid; else left = mid; } y4 = right; left = 0; right = n; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+1+" "+1+" "+n+" "+mid); int ans = nextInt(); if (ans >= 1) right = mid; else left = mid; } y2 = right; left = 1; right = n+1; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+1+" "+mid+" "+n+" "+n); int ans = nextInt(); if (ans >= 1) left = mid; else right = mid; } y3 = left; left = 1; right = n+1; while (right-left > 1) { int mid = (left+right) >> 1; System.out.println("? "+1+" "+mid+" "+n+" "+n); int ans = nextInt(); if (ans >= 2) left = mid; else right = mid; } y1 = left; if (y3 <= y2 && x3 <= x2) { System.out.println("! "+x3+" "+y3+" "+x2+" "+y2+" "+x1+" "+y1+" "+x4+" "+y4); return; } System.out.println("? "+x1+" "+y1+" "+x2+" "+y2); int ans1 = nextInt(); System.out.println("? "+x3+" "+y3+" "+x4+" "+y4); int ans2 = nextInt(); if (ans1==1 && ans2==1) { System.out.println("! "+x1+" "+y1+" "+x2+" "+y2+" "+x3+" "+y3+" "+x4+" "+y4); return; } System.out.println("? "+x1+" "+y3+" "+x2+" "+y4); ans1 = nextInt(); System.out.println("? "+x3+" "+y1+" "+x4+" "+y2); ans2 = nextInt(); if (ans1==1 && ans2==1) { System.out.println("! "+x1+" "+y3+" "+x2+" "+y4+" "+x3+" "+y1+" "+x4+" "+y2); return; } System.out.println("? "+x1+" "+y1+" "+x4+" "+y2); ans1 = nextInt(); System.out.println("? "+x3+" "+y3+" "+x2+" "+y4); ans2 = nextInt(); if (ans1==1 && ans2==1) { System.out.println("! "+x1+" "+y1+" "+x4+" "+y2+" "+x3+" "+y3+" "+x2+" "+y4); return; } System.out.println("? "+x1+" "+y3+" "+x2+" "+y2); ans1 = nextInt(); System.out.println("? "+x3+" "+y1+" "+x4+" "+y4); ans2 = nextInt(); if (ans1==1 && ans2==1) { System.out.println("! "+x1+" "+y3+" "+x2+" "+y2+" "+x3+" "+y1+" "+x4+" "+y4); return; } pw.close(); } private static int nextInt() throws IOException { return Integer.parseInt(next()); } private static long nextLong() throws IOException { return Long.parseLong(next()); } private static double nextDouble() throws IOException { return Double.parseDouble(next()); } private static String next() throws IOException { while (st==null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } }
logn
713_B. Searching Rectangles
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Comparator; import java.util.StringTokenizer; import java.util.function.Function; public class P1196D2 { static boolean multipleIndependent = true; void run() { int n = in.nextInt(); int k = in.nextInt(); char[] s = in.next().toCharArray(); int[] dp = new int[3]; char[] c = {'R', 'G', 'B'}; int min = Integer.MAX_VALUE; for (int i = 0; i < k; i++) { dp[0] += s[i] == c[(i + 0) % 3] ? 0 : 1; dp[1] += s[i] == c[(i + 1) % 3] ? 0 : 1; dp[2] += s[i] == c[(i + 2) % 3] ? 0 : 1; } min = Math.min(Math.min(Math.min(dp[0], dp[1]), dp[2]), min); // System.out.println(Arrays.toString(dp)); for (int i = k; i < n; i++) { dp[0] += (s[i] == c[(i + 0) % 3] ? 0 : 1) - (s[i - k] == c[(i - k + 0) % 3] ? 0 : 1); dp[1] += (s[i] == c[(i + 1) % 3] ? 0 : 1) - (s[i - k] == c[(i - k + 1) % 3] ? 0 : 1); dp[2] += (s[i] == c[(i + 2) % 3] ? 0 : 1) - (s[i - k] == c[(i - k + 2) % 3] ? 0 : 1); min = Math.min(Math.min(Math.min(dp[0], dp[1]), dp[2]), min); // System.out.println(Arrays.toString(dp)); } System.out.println(min); } /* -----: Template :----- */ static InputReader in = new InputReader(System.in); public static void main(String[] args) { P1196D2 p = new P1196D2(); int q = multipleIndependent ? in.nextInt() : 1; while (q-- > 0) { p.run(); } } int numLength(long n) { int l = 0; while (n > 0) { n /= 10; l++; } return l; } <R> long binarySearch(long lowerBound, long upperBound, R value, Function<Long, R> generatorFunction, Comparator<R> comparator) { if (lowerBound <= upperBound) { long mid = (lowerBound + upperBound) / 2; int compare = comparator.compare(generatorFunction.apply(mid), value); if (compare == 0) { return mid; } else if (compare < 0) { return binarySearch(mid + 1, upperBound, value, generatorFunction, comparator); } else { return binarySearch(lowerBound, mid - 1, value, generatorFunction, comparator); } } else { return -1; } } <T> Integer[] sortSimultaneously(T[] key, Comparator<T> comparator, Object[]... moreArrays) { int n = key.length; for (Object[] array : moreArrays) { if (array.length != n) { throw new RuntimeException("Arrays must have equals lengths"); } } Integer[] indices = new Integer[n]; for (int i = 0; i < n; i++) { indices[i] = i; } Comparator<Integer> delegatingComparator = (a, b) -> { return comparator.compare(key[a], key[b]); }; Arrays.sort(indices, delegatingComparator); reorder(indices, key); for (Object[] array : moreArrays) { reorder(indices, array); } return indices; } void reorder(Integer[] indices, Object[] arr) { if (indices.length != arr.length) { throw new RuntimeException("Arrays must have equals lengths"); } int n = arr.length; Object[] copy = new Object[n]; for (int i = 0; i < n; i++) { copy[i] = arr[indices[i]]; } System.arraycopy(copy, 0, arr, 0, n); } int prodMod(int a, int b, int mod) { return (int) (((long) a) * b % mod); } long prodMod(long a, long b, long mod) { long res = 0; a %= mod; b %= mod; while (b > 0) { if ((b & 1) > 0) { res = (res + a) % mod; } a = (a << 1) % mod; b >>= 1; } return res; } long sumMod(int[] b, long mod) { long res = 0; for (int i = 0; i < b.length; i++) { res = (res + b[i] % mod) % mod; } return res; } long sumMod(long[] a, long mod) { long res = 0; for (int i = 0; i < a.length; i++) { res = (res + a[i] % mod) % mod; } return res; } long sumProdMod(int[] a, long b, long mod) { long res = sumMod(a, mod); return prodMod(res, b, mod); } long sumProdMod(long[] a, long b, long mod) { long res = sumMod(a, mod); return prodMod(res, b, mod); } long sumProdMod(int[] a, int[] b, long mod) { if (a.length != b.length) { throw new RuntimeException("Arrays must have equals lengths"); } long res = 0; for (int i = 0; i < a.length; i++) { res = (res + prodMod(a[i], b[i], mod)) % mod; } return res; } long sumProdMod(long[] a, long[] b, long mod) { if (a.length != b.length) { throw new RuntimeException("Arrays must have equals lengths"); } long res = 0; for (int i = 0; i < a.length; i++) { res = (res + prodMod(a[i], b[i], mod)) % mod; } return res; } int[] toPrimitive(Integer[] arr) { int[] res = new int[arr.length]; for (int i = 0; i < arr.length; i++) { res[i] = arr[i]; } return res; } int[][] toPrimitive(Integer[][] arr) { int[][] res = new int[arr.length][]; for (int i = 0; i < arr.length; i++) { res[i] = toPrimitive(arr[i]); } return res; } long[] toPrimitive(Long[] arr) { long[] res = new long[arr.length]; for (int i = 0; i < arr.length; i++) { res[i] = arr[i]; } return res; } long[][] toPrimitive(Long[][] arr) { long[][] res = new long[arr.length][]; for (int i = 0; i < arr.length; i++) { res[i] = toPrimitive(arr[i]); } return res; } Integer[] toWrapper(int[] arr) { Integer[] res = new Integer[arr.length]; for (int i = 0; i < arr.length; i++) { res[i] = arr[i]; } return res; } Integer[][] toWrapper(int[][] arr) { Integer[][] res = new Integer[arr.length][]; for (int i = 0; i < arr.length; i++) { res[i] = toWrapper(arr[i]); } return res; } Long[] toWrapper(long[] arr) { Long[] res = new Long[arr.length]; for (int i = 0; i < arr.length; i++) { res[i] = arr[i]; } return res; } Long[][] toWrapper(long[][] arr) { Long[][] res = new Long[arr.length][]; for (int i = 0; i < arr.length; i++) { res[i] = toWrapper(arr[i]); } return res; } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public int[] nextIntArray(int n) { int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = nextInt(); } return arr; } public <T> T[] nextIntArray(int n, Function<Integer, T> function, Class<T> c) { T[] arr = (T[]) Array.newInstance(c, n); for (int i = 0; i < n; i++) { arr[i] = function.apply(nextInt()); } return arr; } public long[] nextLongArray(int n) { long[] arr = new long[n]; for (int i = 0; i < n; i++) { arr[i] = nextLong(); } return arr; } public <T> T[] nextLongArray(int n, Function<Long, T> function, Class<T> c) { T[] arr = (T[]) Array.newInstance(c, n); for (int i = 0; i < n; i++) { arr[i] = function.apply(nextLong()); } return arr; } public int[][] nextIntMap(int n, int m) { int[][] map = new int[n][m]; for (int i = 0; i < n; i++) { map[i] = nextIntArray(m); } return map; } public long[][] nextLongMap(int n, int m) { long[][] map = new long[n][m]; for (int i = 0; i < n; i++) { map[i] = nextLongArray(m); } return map; } public char[][] nextCharMap(int n) { char[][] map = new char[n][]; for (int i = 0; i < n; i++) { map[i] = next().toCharArray(); } return map; } public void readColumns(Object[]... columns) { int n = columns[0].length; for (Object[] column : columns) { if (column.length != n) { throw new RuntimeException("Arrays must have equals lengths"); } } for (int i = 0; i < n; i++) { for (Object[] column : columns) { column[i] = read(column[i].getClass()); } } } public <T> T read(Class<T> c) { throw new UnsupportedOperationException("To be implemented"); } } }
quadratic
1196_D2. RGB Substring (hard version)
CODEFORCES
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if (n % 2 == 0) { System.out.printf("%d %d", 4, n - 4); } else { System.out.printf("%d %d", 9, n - 9); } } }
constant
472_A. Design Tutorial: Learn from Math
CODEFORCES
import java.util.ArrayList; import java.util.Scanner; public class primes { public static void main(String [] args){ ArrayList<Integer> numb=new ArrayList<Integer>(); Scanner br1 = new Scanner(System.in); int n=br1.nextInt(); int steps=br1.nextInt(); //if(n>2)numb.add(2); if(n>=3)numb.add(3); for(int j=4;j<=n;j++){ if(chekprime(j)==0){ numb.add(j); //System.out.println(j); } } int counter =0; for(int give=0;give<numb.size();give++) {if("YES".equals(sumup(numb, 2, numb.get(give)))){ counter++; // System.out.println(numb.get(give)+"ksjdfskldfgaskldfgasklfgaskldfgaklsfgasdklfgaskldfgaskldfgasdklfg"); } } //System.out.println(counter); if(counter>=steps)System.out.println("YES"); else System.out.println("NO"); } public static String sumup(ArrayList<Integer> list,int number,int NUM){ String ret="NO"; ArrayList<Integer> result=new ArrayList<Integer>(); ArrayList<Integer>[] arList=new ArrayList[number]; for(int i=0;i<number;i++){ arList[i]=new ArrayList<Integer>(); arList[i]=(ArrayList<Integer>)list.clone(); for(int k=0;k<i;k++){ arList[i].add(0,arList[i].remove(arList[i].size()-1)); } } int [] temp=new int[list.size()]; for(int z=0;z<list.size();z++){ for(int count=0;count<number;count++){ temp[z]+=arList[count].get(z); //System.out.println(arList[count].get(z)); } result.add(temp[z]); } if(result.contains(NUM-1)) { //System.out.println(NUM-1); ret="YES"; } return ret; } public static int chekprime(int n){ int flag=0; for(int i=2;i<=Math.sqrt(n)+1;i++) { if(n%i==0){ flag=1; break; } } return flag; } }
linear
17_A. Noldbach problem
CODEFORCES
import java.util.*; public class village { static int[] X, A; public void solve() { Scanner in = new Scanner(System.in); int N = in.nextInt(), T = in.nextInt(); X = new int[N]; A = new int[N]; for(int i = 0; i < N; i++) { X[i] = in.nextInt(); A[i] = in.nextInt(); } if(N == 1) { System.out.println("2"); return; } List<Integer> x = new ArrayList<Integer>(); for(int i = 0; i < N; i++) { x.add(i); } Collections.sort(x, new Comp()); int places = 0; for(int i = 0; i < N-1; i++) { double space = (X[x.get(i+1)]-X[x.get(i)]-A[x.get(i+1)]/2.0-A[x.get(i)]/2.0); if(space < T) { continue; } if(space - T < 1e-9) { places++; } else if(space > T) { places+=2; } } System.out.println(places+2); } public class Comp implements Comparator<Integer> { public int compare(Integer i1, Integer i2) { return X[i1]-X[i2]; } } public static void main(String[] args) { new village().solve(); } }
nlogn
15_A. Cottage Village
CODEFORCES
import java.util.*; public class Solution { public static void main(String[] args) { class Pair { int start; int end; public Pair(int start, int end) { this.start = start; this.end = end; } } Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] array = new int[n]; for (int i=0; i<n; i++) array[i] = sc.nextInt(); int maxLen = 0; int key = -1; HashMap<Integer, List<Pair>> ans = new HashMap<>(); for (int i=0; i<n; i++){ int currSum = 0; for (int j=i; j>=0; j--){ currSum = currSum + array[j]; if (!ans.containsKey(currSum)){ ans.put(currSum, new ArrayList<>()); } List<Pair> pairs = ans.get(currSum); if (pairs.size() == 0 || pairs.get(pairs.size()-1).end <= j){ pairs.add(new Pair(j+1, i+1)); } if (pairs.size() > maxLen){ maxLen = pairs.size(); key = currSum; } } } System.out.println(maxLen); for (Pair pair : ans.get(key)){ System.out.println(pair.start + " " + pair.end); } } }
quadratic
1141_F2. Same Sum Blocks (Hard)
CODEFORCES
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 = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskB solver = new TaskB(); solver.solve(1, in, out); out.close(); } static class TaskB { int[][] dr = new int[][]{{0, 0, 0, -1}, {0, 0, -1, 0}, {0, 1, 0, 0}, {1, 0, 0, 0}}; int[][] dd = new int[][]{{1, 3}, {0, 2}, {1, 3}, {0, 2}}; PrintWriter out; InputReader in; int[] re1; int[] re2; int N; public void solve(int testNumber, InputReader in, PrintWriter out) { N = in.nextInt(); int r[] = new int[]{1, 1, N, N}; this.out = out; this.in = in; re1 = new int[]{1, 1, 1, 1}; re2 = new int[]{2, 1, 2, 1}; //probuje najpierw lewa sciane int fr[] = moveSide(r, dr[2], dd[2]); int sr[] = subtract(r, fr); if (!validSeparation(sr)) { fr = moveSide(r, dr[1], dd[1]); sr = subtract(r, fr); } fr = boundary(fr); sr = boundary(sr); out.println(String.format("! %d %d %d %d %d %d %d %d", fr[0], fr[1], fr[2], fr[3], sr[0], sr[1], sr[2], sr[3])); } private boolean validSeparation(int[] sr) { if (!validRectangle(sr)) return false; out.println(String.format("? %d %d %d %d", sr[0], sr[1], sr[2], sr[3])); out.flush(); return in.nextInt() == 1; } private boolean validRectangle(int[] sr) { for (int i = 0; i < 4; i++) { if (sr[i] < 1 || sr[i] > N) return false; } return true; } private int[] boundary(int[] r) { for (int d = 0; d < 4; d++) { r = moveSide(r, dr[d], dd[d]); } return r; } private int[] subtract(final int[] r, final int[] fr) { if (r[1] == fr[1]) { //jesli lewy dolny taki sam to ucieto horyzontalnie od gory return new int[]{fr[2] + 1, r[1], r[2], r[3]}; } //else ucieto wertykalnie od lewej return new int[]{r[0], r[1], r[2], fr[1] - 1}; } private int[] moveSide(final int[] rect, final int[] factors, final int[] widths) { int width = Math.abs(rect[widths[0]] - rect[widths[1]]); int lo = -1, hi = width + 1; while (lo + 1 < hi) { int m = lo + (hi - lo) / 2; int qr[] = new int[4]; for (int d = 0; d < 4; d++) qr[d] = rect[d] + factors[d] * m; int ans = query(qr); if (ans != 0) { lo = m; } else { hi = m; } } int ans_rect[] = new int[4]; for (int d = 0; d < 4; d++) ans_rect[d] = rect[d] + factors[d] * lo; return ans_rect; } private int query(final int[] qr) { int ans = 0; out.println(String.format("? %d %d %d %d", qr[0], qr[1], qr[2], qr[3])); out.flush(); ans = in.nextInt(); // if (contains(qr, re1)) ans++; // if (contains(qr, re2)) ans++; return ans; } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } }
logn
713_B. Searching Rectangles
CODEFORCES
import java.util.Scanner; public class A_Lucky_Division { public static void main(String[] args){ Scanner input=new Scanner(System.in); int number=input.nextInt(); int flag=0; if(number%4==0)flag=1; else if(number%7==0)flag=1; else if(number%47==0)flag=1; else if(number%74==0)flag=1; else if(number%444==0)flag=1; else if(number%447==0)flag=1; else if(number%474==0)flag=1; else if(number%477==0)flag=1; else if(number%744==0)flag=1; else if(number%747==0)flag=1; else if(number%774==0)flag=1; else if(number%777==0)flag=1; if(flag==1)System.out.println("YES"); else System.out.println("NO"); } }
constant
122_A. Lucky Division
CODEFORCES
import java.util.HashSet; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); HashSet<Integer> set = new HashSet<>(); for(int i = 0; i<n; i++){ int a = sc.nextInt(); if(a!=0){ set.add(a); } } System.out.println(set.size()); } }
linear
992_A. Nastya and an Array
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Code { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); HashMap<Double,Integer>h = new HashMap<>(); double [] temp = new double[n]; int m = 0; for(int i=0;i<n;i++) { String l = br.readLine(); int[] x = new int[4]; int k=0; boolean t = false; for(int j=0;j<l.length();j++) { if(l.charAt(j)=='(' || l.charAt(j)=='+' || l.charAt(j)==')' || l.charAt(j)=='/') x[k++] = j; } double a = Integer.parseInt(l.substring(x[0]+1,x[1])); double b = Integer.parseInt(l.substring(x[1]+1, x[2])); double c = Integer.parseInt(l.substring(x[3]+1)); temp[m++] = (a+b)/c; //System.out.print((a+b)/c + " "); if(h.containsKey((a+b)/c)) h.put((a+b)/c, h.get((a+b)/c)+1); else h.put((a+b)/c, 1); } //System.out.println(h); for(int i=0;i<n;i++) { System.out.print(h.get(temp[i]) + " "); } } }
linear
958_D1. Hyperspace Jump (easy)
CODEFORCES
/* Keep solving problems. */ import java.util.*; import java.io.*; public class CFA { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; final long MOD = 1000L * 1000L * 1000L + 7; int[] dx = {0, -1, 0, 1}; int[] dy = {1, 0, -1, 0}; void solve() throws IOException { int n = nextInt(); int[] arr = nextIntArr(n); int cnt = 0; for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (arr[i] > arr[j]) { cnt++; } } } int m = nextInt(); boolean[] vis = new boolean[n]; for (int i = 0; i < m; i++) { int l = nextInt() - 1; int r = nextInt() - 1; int len = r - l + 1; if (len * (len - 1) / 2 % 2 != 0) { cnt++; } if (cnt % 2 != 0) { outln("odd"); } else { outln("even"); } } } void shuffle(int[] a) { int n = a.length; for(int i = 0; i < n; i++) { int r = i + (int) (Math.random() * (n - i)); int tmp = a[i]; a[i] = a[r]; a[r] = tmp; } } long gcd(long a, long b) { while(a != 0 && b != 0) { long c = b; b = a % b; a = c; } return a + b; } private void outln(Object o) { out.println(o); } private void out(Object o) { out.print(o); } public CFA() throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); solve(); out.close(); } public static void main(String[] args) throws IOException { new CFA(); } public long[] nextLongArr(int n) throws IOException{ long[] res = new long[n]; for(int i = 0; i < n; i++) res[i] = nextLong(); return res; } public int[] nextIntArr(int n) throws IOException { int[] res = new int[n]; for(int i = 0; i < n; i++) res[i] = nextInt(); return res; } public String nextToken() { while (st == null || !st.hasMoreTokens()) { try { st = new StringTokenizer(br.readLine()); } catch (Exception e) { eof = true; return null; } } return st.nextToken(); } public String nextString() { try { return br.readLine(); } catch (IOException e) { eof = true; return null; } } public int nextInt() throws IOException { return Integer.parseInt(nextToken()); } public long nextLong() throws IOException { return Long.parseLong(nextToken()); } public double nextDouble() throws IOException { return Double.parseDouble(nextToken()); } }
quadratic
911_D. Inversion Counting
CODEFORCES
import java.util.Scanner; import java.io.PrintWriter; /** * @author Egor Kulikov (kulikov@devexperts.com) */ public class Spreadsheets implements Runnable { private Scanner in = new Scanner(System.in); private PrintWriter out = new PrintWriter(System.out); private String s, ans; public static void main(String[] args) { new Thread(new Spreadsheets()).start(); } private void read() { s = in.next(); } private void solve() { if (s.matches("R\\d+C\\d+")) { s = s.replace('R', ' ').replace('C', ' '); Scanner ss = new Scanner(s); int r = ss.nextInt(); int c = ss.nextInt(); c--; StringBuffer b = new StringBuffer(); int c26 = 26; int cc = 0; while (cc + c26 <= c) { cc += c26; c26 *= 26; } c -= cc; while (c26 > 1) { c26 /= 26; b.append((char) (c / c26 + 'A')); c %= c26; } ans = b.toString() + r; } else { int p = 0; while (!Character.isDigit(s.charAt(p))) { p++; } int c26 = 1; int cc = 0; for (int i = 0; i < p; i++) { cc += c26; c26 *= 26; } for (int i = 0; i < p; i++) { c26 /= 26; cc += c26 * (s.charAt(i) - 'A'); } ans = "R" + s.substring(p) + "C" + cc; } } private void write() { out.println(ans); } public void run() { int n = in.nextInt(); for (int i = 0; i < n; i++) { read(); solve(); write(); } out.close(); } }
linear
1_B. Spreadsheets
CODEFORCES
import com.sun.org.apache.xerces.internal.util.SynchronizedSymbolTable; import jdk.management.cmm.SystemResourcePressureMXBean; import java.awt.*; import java.io.*; import java.lang.reflect.Array; import java.text.DecimalFormat; import java.util.*; import java.util.List; import java.math.*; public class Newbie { static InputReader sc = new InputReader(System.in); static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { solver s = new solver(); int t = 1; while (t > 0) { s.solve(); t--; } out.close(); } /* static class descend implements Comparator<pair1> { public int compare(pair1 o1, pair1 o2) { if (o1.pop != o2.pop) return (int) (o1.pop - o2.pop); else return o1.in - o2.in; } }*/ static class InputReader { public BufferedReader br; public StringTokenizer token; public InputReader(InputStream stream) { br = new BufferedReader(new InputStreamReader(stream), 32768); token = null; } public String next() { while (token == null || !token.hasMoreTokens()) { try { token = new StringTokenizer(br.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return token.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } } static class card { long a; int cnt; int i; public card(long a, int cnt, int i) { this.a = a; this.cnt = cnt; this.i = i; } } static class ascend implements Comparator<pair> { public int compare(pair o1, pair o2) { return o1.a - o2.a; } } static class extra { static boolean v[] = new boolean[100001]; static List<Integer> l = new ArrayList<>(); static int t; static void shuffle(long a[]) { List<Long> l = new ArrayList<>(); for (int i = 0; i < a.length; i++) l.add(a[i]); Collections.shuffle(l); for (int i = 0; i < a.length; i++) a[i] = l.get(i); } static long gcd(long a, long b) { if (b == 0) return a; else return gcd(b, a % b); } static boolean valid(int i, int j, int r, int c) { if (i >= 0 && i < r && j >= 0 && j < c) return true; else return false; } static void seive() { for (int i = 2; i < 100001; i++) { if (!v[i]) { t++; l.add(i); for (int j = 2 * i; j < 100001; j += i) v[j] = true; } } } static int binary(long a[], long val, int n) { int mid = 0, l = 0, r = n - 1, ans = 0; while (l <= r) { mid = (l + r) >> 1; if (a[mid] == val) { r = mid - 1; ans = mid; } else if (a[mid] > val) r = mid - 1; else { l = mid + 1; ans = l; } } return (ans + 1); } static long fastexpo(int x, int y) { long res = 1; while (y > 0) { if ((y & 1) == 1) { res *= x; } y = y >> 1; x = x * x; } return res; } static long lfastexpo(int x, int y, int p) { long res = 1; x = x % p; while (y > 0) { if ((y & 1) == 1) { res = (res * x) % p; } y = y >> 1; x = (x * x) % p; } return res; } } static class pair { int a; int b; public pair(int a, int i) { this.a = a; this.b = i; } } static class pair1 { pair p; int in; public pair1(pair a, int n) { this.p = a; this.in = n; } } static long m = (long) 1e9 + 7; static class solver { void solve() { int n = sc.nextInt(); int ans=0; int a[]=new int[2*n]; for (int i = 0; i < 2 * n; i++) { a[i]=sc.nextInt(); } for(int i=0;i<2*n;i++) { if(a[i]>0) { int j=0; for(j=i+1;a[i]!=a[j];j++) { if(a[j]>0) ans++; } a[j]=0; } } System.out.println(ans); } } }
quadratic
995_B. Suit and Tie
CODEFORCES
import java.util.*; import java.io.*; public class Deltix { static PrintWriter out; public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); Stack<Integer> s = new Stack<>(); int [] a = new int[n]; for (int i = 0; i < n; ++i) a[i] = sc.nextInt(); for (int i = 0; i < n; i++) { if (a[i] == 1) { s.push(1); } else { while (s.peek() != a[i] - 1) { s.pop(); } s.pop(); s.push(a[i]); } print(s); } } out.close(); } static void print(Stack<Integer> s) { ArrayDeque<Integer> a = new ArrayDeque<>(); while (!s.isEmpty()) { a.addFirst(s.pop()); } while (!a.isEmpty()) { int x = a.pollFirst(); out.print(x); s.push(x); if (a.size() != 0) out.print("."); } out.println(); } static void sort(int[] a) { ArrayList<Integer> q = new ArrayList<>(); for (int i : a) q.add(i); Collections.sort(q); for (int i = 0; i < a.length; i++) a[i] = q.get(i); } static void sort(long[] a) { ArrayList<Long> q = new ArrayList<>(); for (long i : a) q.add(i); Collections.sort(q); for (int i = 0; i < a.length; i++) a[i] = q.get(i); } //-----------MyScanner class for faster input---------- public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
cubic
1523_C. Compression and Expansion
CODEFORCES
import java.util.*; import java.io.*; import java.math.*; import java.awt.geom.*; public class FunctionHeight { public static void main(String[] args) { MyScanner sc = new MyScanner(); long n = sc.nl(); long k = sc.nl(); long ans = (n+k-1)/n; System.out.println(ans); } /////////// TEMPLATE FROM HERE ///////////////// private static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int ni() { return Integer.parseInt(next()); } float nf() { return Float.parseFloat(next()); } long nl() { return Long.parseLong(next()); } double nd() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
constant
1036_A. Function Height
CODEFORCES
import java.awt.Point; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.PrintStream; import java.util.HashSet; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class FireAgain { Point coordinate; Queue<Point> q = new LinkedList<Point>(); int m, n; boolean[][] arr; PrintStream out ; void bfs(Point start) { while (!q.isEmpty()) { Point front = q.poll(); Point p = new Point(); p.x = front.x - 1; p.y = front.y; if (p.x >= 1 && p.x <= n && p.y <= m && p.y >= 1) { if (!arr[p.x][p.y]) { arr[p.x][p.y] = true; q.add(p); } } p = new Point(); p.x = front.x + 1; p.y = front.y; if (p.x >= 1 && p.x <= n && p.y <= m && p.y >= 1) if (!arr[p.x][p.y]) { arr[p.x][p.y] = true; q.add(p); } p = new Point() ; p.x = front.x; p.y = front.y + 1; if (p.x >= 1 && p.x <= n && p.y <= m && p.y >= 1) if (!arr[p.x][p.y]) { arr[p.x][p.y] = true; q.add(p); } p = new Point() ; p.x = front.x; p.y = front.y - 1; if (p.x >= 1 && p.x <= n && p.y <= m && p.y >= 1) if (!arr[p.x][p.y]) { arr[p.x][p.y] = true; q.add(p); } if (q.size() == 0) out.print(front.x + " " + front.y); } } /** * @param args * @throws FileNotFoundException */ public static void main(String[] args) throws FileNotFoundException { // TODO Auto-generated method stub FireAgain fa = new FireAgain(); Scanner Scan = new Scanner(new FileInputStream("input.txt")); fa.out = new PrintStream(new File("output.txt")); fa.n = Scan.nextInt(); fa.m = Scan.nextInt(); int k = Scan.nextInt(); fa.arr = new boolean[2001][2001]; for (int i = 0; i < k; i++) { fa.coordinate = new Point(); fa.coordinate.x = Scan.nextInt(); fa.coordinate.y = Scan.nextInt(); fa.q.add(fa.coordinate); fa.arr[fa.coordinate.x][fa.coordinate.y] = true; } fa.bfs(fa.q.peek()); } }
cubic
35_C. Fire Again
CODEFORCES
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.IOException; import java.io.BufferedReader; import java.io.Reader; 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 = System.in; OutputStream outputStream = System.out; MyInput in = new MyInput(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskC solver = new TaskC(); solver.solve(1, in, out); out.close(); } static class TaskC { public void solve(int testNumber, MyInput in, PrintWriter out) { int n = in.nextInt(); int r = in.nextInt(); int[] x = in.nextIntArray(n); double[] py = new double[n]; for (int i = 0; i < n; i++) { double y = r; for (int j = 0; j < i; j++) { int dx = Math.abs(x[i] - x[j]); if (dx > 2 * r) continue; y = Math.max(y, Math.sqrt(4 * r * r - dx * dx) + py[j]); } py[i] = y; } for (int i = 0; i < n; i++) { out.printf("%.10f%s", py[i], i == n - 1 ? "\n" : " "); } } } static class MyInput { private final BufferedReader in; private static int pos; private static int readLen; private static final char[] buffer = new char[1024 * 8]; private static char[] str = new char[500 * 8 * 2]; private static boolean[] isDigit = new boolean[256]; private static boolean[] isSpace = new boolean[256]; private static boolean[] isLineSep = new boolean[256]; static { for (int i = 0; i < 10; i++) { isDigit['0' + i] = true; } isDigit['-'] = true; isSpace[' '] = isSpace['\r'] = isSpace['\n'] = isSpace['\t'] = true; isLineSep['\r'] = isLineSep['\n'] = true; } public MyInput(InputStream is) { in = new BufferedReader(new InputStreamReader(is)); } public int read() { if (pos >= readLen) { pos = 0; try { readLen = in.read(buffer); } catch (IOException e) { throw new RuntimeException(); } if (readLen <= 0) { throw new MyInput.EndOfFileRuntimeException(); } } return buffer[pos++]; } public int nextInt() { int len = 0; str[len++] = nextChar(); len = reads(len, isSpace); int i = 0; int ret = 0; if (str[0] == '-') { i = 1; } for (; i < len; i++) ret = ret * 10 + str[i] - '0'; if (str[0] == '-') { ret = -ret; } return ret; } public char nextChar() { while (true) { final int c = read(); if (!isSpace[c]) { return (char) c; } } } int reads(int len, boolean[] accept) { try { while (true) { final int c = read(); if (accept[c]) { break; } if (str.length == len) { char[] rep = new char[str.length * 3 / 2]; System.arraycopy(str, 0, rep, 0, str.length); str = rep; } str[len++] = (char) c; } } catch (MyInput.EndOfFileRuntimeException e) { } return len; } public int[] nextIntArray(final int n) { final int[] res = new int[n]; for (int i = 0; i < n; i++) { res[i] = nextInt(); } return res; } static class EndOfFileRuntimeException extends RuntimeException { } } }
quadratic
908_C. New Year and Curling
CODEFORCES
import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; public class Main { public static void main(String[] argv) { new Main().run(); } void run() { in = new Scanner(System.in); out = new PrintWriter(System.out); try { solve(); } finally { out.close(); } } PrintWriter out; Scanner in; class Pair { int x; int y; Pair(int x, int y) { this.x = x; this.y = y; } @Override public String toString() { return x + " " + y; } } int[] readArr(int size) { int[] a = new int[size]; for (int i = 0; i < size; i++) { a[i] = in.nextInt(); } return a; } void solve() { int n = in.nextInt(); int k = in.nextInt(); Pair[] a = new Pair[n]; for (int i = 0; i < n; i++) { a[i] = new Pair(in.nextInt(), in.nextInt()); } Arrays.sort(a, new Comparator<Pair>() { @Override public int compare(Pair p1, Pair p2) { if (p2.x != p1.x) { return p2.x - p1.x; } return p1.y - p2.y; } }); int cnt = 1; int ans = 0; int[] res = new int[n]; res[0] = 1; for (int i = 1; i < n; i++) { if (!(a[i].x == a[i - 1].x && a[i].y == a[i - 1].y)) { cnt++; } res[i] = cnt; //out.println(a[i] + " * " + cnt); } int el = res[k - 1]; for (int i = 0; i < n; i++) { if (res[i] == el) { ans++; } } out.println(ans); } }
nlogn
166_A. Rank List
CODEFORCES
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc = new Scanner(System.in); long l= sc.nextLong(); long r = sc.nextLong(); if(l%2==0){ if(r>=l+2){ System.out.println(l + " " + (l+1) + " " + (l+2)); } else{ System.out.println(-1); } } else{ if(r>=l+3){ System.out.println((l+1) + " " + (l+2) + " " + (l+3)); } else{ System.out.println(-1); } } } }
constant
483_A. Counterexample
CODEFORCES
import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.math.BigInteger; import java.nio.charset.Charset; import java.util.*; public class CFContest { public static void main(String[] args) throws Exception { boolean local = System.getProperty("ONLINE_JUDGE") == null; boolean async = false; Charset charset = Charset.forName("ascii"); FastIO io = local ? new FastIO(new FileInputStream("D:\\DATABASE\\TESTCASE\\Code.in"), System.out, charset) : new FastIO(System.in, System.out, charset); Task task = new Task(io, new Debug(local)); if (async) { Thread t = new Thread(null, task, "dalt", 1 << 27); t.setPriority(Thread.MAX_PRIORITY); t.start(); t.join(); } else { task.run(); } if (local) { io.cache.append("\n\n--memory -- \n" + ((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) >> 20) + "M"); } io.flush(); } public static class Task implements Runnable { final FastIO io; final Debug debug; int inf = (int) 1e9 + 2; BitOperator bitOperator = new BitOperator(); Modular modular = new Modular((int) 1e9 + 7); public Task(FastIO io, Debug debug) { this.io = io; this.debug = debug; } @Override public void run() { solve(); } int[][][] f; int n; int t; int[] songTimes; int[] songTypes; int mask; public void solve() { n = io.readInt(); t = io.readInt(); mask = 1 << n; f = new int[4][mask][t + 1]; for (int i = 0; i < 4; i++) { for (int j = 0; j < mask; j++) { for (int k = 0; k <= t; k++) { f[i][j][k] = -1; } } } songTimes = new int[n + 1]; songTypes = new int[n + 1]; for (int i = 1; i <= n; i++) { songTimes[i] = io.readInt(); songTypes[i] = io.readInt(); } int ans = 0; for (int i = 0; i < 4; i++) { for (int j = 0; j < mask; j++) { ans = modular.plus(ans, f(i, j, t)); } } io.cache.append(ans); } int f(int i, int j, int k) { if (j == 0) { return k == 0 && i == 0 ? 1 : 0; } if (k < 0) { return 0; } if (f[i][j][k] == -1) { f[i][j][k] = 0; for (int x = 1; x <= n; x++) { if (songTypes[x] != i || bitOperator.bitAt(j, x - 1) == 0) { continue; } for (int y = 0; y < 4; y++) { if (y == i) { continue; } f[i][j][k] = modular.plus(f[i][j][k], f(y, bitOperator.setBit(j, x - 1, false), k - songTimes[x])); } } } return f[i][j][k]; } } /** * 模运算 */ public static class Modular { int m; public Modular(int m) { this.m = m; } public int valueOf(int x) { x %= m; if (x < 0) { x += m; } return x; } public int valueOf(long x) { x %= m; if (x < 0) { x += m; } return (int) x; } public int mul(int x, int y) { return valueOf((long) x * y); } public int plus(int x, int y) { return valueOf(x + y); } @Override public String toString() { return "mod " + m; } } public static class BitOperator { public int bitAt(int x, int i) { return (x >> i) & 1; } public int bitAt(long x, int i) { return (int) ((x >> i) & 1); } public int setBit(int x, int i, boolean v) { if (v) { x |= 1 << i; } else { x &= ~(1 << i); } return x; } public long setBit(long x, int i, boolean v) { if (v) { x |= 1L << i; } else { x &= ~(1L << i); } return x; } /** * Determine whether x is subset of y */ public boolean subset(long x, long y) { return intersect(x, y) == x; } /** * Merge two set */ public long merge(long x, long y) { return x | y; } public long intersect(long x, long y) { return x & y; } public long differ(long x, long y) { return x - intersect(x, y); } } public static class Randomized { static Random random = new Random(); public static double nextDouble(double min, double max) { return random.nextDouble() * (max - min) + min; } public static void randomizedArray(int[] data, int from, int to) { to--; for (int i = from; i <= to; i++) { int s = nextInt(i, to); int tmp = data[i]; data[i] = data[s]; data[s] = tmp; } } public static void randomizedArray(long[] data, int from, int to) { to--; for (int i = from; i <= to; i++) { int s = nextInt(i, to); long tmp = data[i]; data[i] = data[s]; data[s] = tmp; } } public static void randomizedArray(double[] data, int from, int to) { to--; for (int i = from; i <= to; i++) { int s = nextInt(i, to); double tmp = data[i]; data[i] = data[s]; data[s] = tmp; } } public static void randomizedArray(float[] data, int from, int to) { to--; for (int i = from; i <= to; i++) { int s = nextInt(i, to); float tmp = data[i]; data[i] = data[s]; data[s] = tmp; } } public static <T> void randomizedArray(T[] data, int from, int to) { to--; for (int i = from; i <= to; i++) { int s = nextInt(i, to); T tmp = data[i]; data[i] = data[s]; data[s] = tmp; } } public static int nextInt(int l, int r) { return random.nextInt(r - l + 1) + l; } } public static class Splay implements Cloneable { public static final Splay NIL = new Splay(); static { NIL.left = NIL; NIL.right = NIL; NIL.father = NIL; NIL.size = 0; NIL.key = Integer.MIN_VALUE; NIL.sum = 0; } Splay left = NIL; Splay right = NIL; Splay father = NIL; int size = 1; int key; long sum; public static void splay(Splay x) { if (x == NIL) { return; } Splay y, z; while ((y = x.father) != NIL) { if ((z = y.father) == NIL) { y.pushDown(); x.pushDown(); if (x == y.left) { zig(x); } else { zag(x); } } else { z.pushDown(); y.pushDown(); x.pushDown(); if (x == y.left) { if (y == z.left) { zig(y); zig(x); } else { zig(x); zag(x); } } else { if (y == z.left) { zag(x); zig(x); } else { zag(y); zag(x); } } } } x.pushDown(); x.pushUp(); } public static void zig(Splay x) { Splay y = x.father; Splay z = y.father; Splay b = x.right; y.setLeft(b); x.setRight(y); z.changeChild(y, x); y.pushUp(); } public static void zag(Splay x) { Splay y = x.father; Splay z = y.father; Splay b = x.left; y.setRight(b); x.setLeft(y); z.changeChild(y, x); y.pushUp(); } public void setLeft(Splay x) { left = x; x.father = this; } public void setRight(Splay x) { right = x; x.father = this; } public void changeChild(Splay y, Splay x) { if (left == y) { setLeft(x); } else { setRight(x); } } public void pushUp() { if (this == NIL) { return; } size = left.size + right.size + 1; sum = left.sum + right.sum + key; } public void pushDown() { } public static int toArray(Splay root, int[] data, int offset) { if (root == NIL) { return offset; } offset = toArray(root.left, data, offset); data[offset++] = root.key; offset = toArray(root.right, data, offset); return offset; } public static void toString(Splay root, StringBuilder builder) { if (root == NIL) { return; } root.pushDown(); toString(root.left, builder); builder.append(root.key).append(','); toString(root.right, builder); } public Splay clone() { try { return (Splay) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } } public static Splay cloneTree(Splay splay) { if (splay == NIL) { return NIL; } splay = splay.clone(); splay.left = cloneTree(splay.left); splay.right = cloneTree(splay.right); return splay; } public static Splay add(Splay root, Splay node) { if (root == NIL) { return node; } Splay p = root; while (root != NIL) { p = root; root.pushDown(); if (root.key < node.key) { root = root.right; } else { root = root.left; } } if (p.key < node.key) { p.setRight(node); } else { p.setLeft(node); } p.pushUp(); splay(node); return node; } /** * Make the node with the minimum key as the root of tree */ public static Splay selectMinAsRoot(Splay root) { if (root == NIL) { return root; } root.pushDown(); while (root.left != NIL) { root = root.left; root.pushDown(); } splay(root); return root; } /** * Make the node with the maximum key as the root of tree */ public static Splay selectMaxAsRoot(Splay root) { if (root == NIL) { return root; } root.pushDown(); while (root.right != NIL) { root = root.right; root.pushDown(); } splay(root); return root; } /** * delete root of tree, then merge remain nodes into a new tree, and return the new root */ public static Splay deleteRoot(Splay root) { root.pushDown(); Splay left = splitLeft(root); Splay right = splitRight(root); return merge(left, right); } /** * detach the left subtree from root and return the root of left subtree */ public static Splay splitLeft(Splay root) { root.pushDown(); Splay left = root.left; left.father = NIL; root.setLeft(NIL); root.pushUp(); return left; } /** * detach the right subtree from root and return the root of right subtree */ public static Splay splitRight(Splay root) { root.pushDown(); Splay right = root.right; right.father = NIL; root.setRight(NIL); root.pushUp(); return right; } public static Splay merge(Splay a, Splay b) { if (a == NIL) { return b; } if (b == NIL) { return a; } a = selectMaxAsRoot(a); a.setRight(b); a.pushUp(); return a; } public static Splay selectKthAsRoot(Splay root, int k) { if (root == NIL) { return NIL; } Splay trace = root; Splay father = NIL; while (trace != NIL) { father = trace; trace.pushDown(); if (trace.left.size >= k) { trace = trace.left; } else { k -= trace.left.size + 1; if (k == 0) { break; } else { trace = trace.right; } } } splay(father); return father; } public static Splay selectKeyAsRoot(Splay root, int k) { if (root == NIL) { return NIL; } Splay trace = root; Splay father = NIL; Splay find = NIL; while (trace != NIL) { father = trace; trace.pushDown(); if (trace.key > k) { trace = trace.left; } else { if (trace.key == k) { find = trace; trace = trace.left; } else { trace = trace.right; } } } splay(father); if (find != NIL) { splay(find); return find; } return father; } public static Splay bruteForceMerge(Splay a, Splay b) { if (a == NIL) { return b; } else if (b == NIL) { return a; } if (a.size < b.size) { Splay tmp = a; a = b; b = tmp; } a = selectMaxAsRoot(a); int k = a.key; while (b != NIL) { b = selectMinAsRoot(b); if (b.key >= k) { break; } Splay kickedOut = b; b = deleteRoot(b); a = add(a, kickedOut); } return merge(a, b); } public static Splay[] split(Splay root, int key) { if (root == NIL) { return new Splay[]{NIL, NIL}; } Splay p = root; while (root != NIL) { p = root; root.pushDown(); if (root.key > key) { root = root.left; } else { root = root.right; } } splay(p); if (p.key <= key) { return new Splay[]{p, splitRight(p)}; } else { return new Splay[]{splitLeft(p), p}; } } @Override public String toString() { StringBuilder builder = new StringBuilder().append(key).append(":"); toString(cloneTree(this), builder); return builder.toString(); } } public static class FastIO { public final StringBuilder cache = new StringBuilder(); private final InputStream is; private final OutputStream os; private final Charset charset; private StringBuilder defaultStringBuf = new StringBuilder(1 << 8); private byte[] buf = new byte[1 << 13]; private int bufLen; private int bufOffset; private int next; public FastIO(InputStream is, OutputStream os, Charset charset) { this.is = is; this.os = os; this.charset = charset; } public FastIO(InputStream is, OutputStream os) { this(is, os, Charset.forName("ascii")); } private int read() { while (bufLen == bufOffset) { bufOffset = 0; try { bufLen = is.read(buf); } catch (IOException e) { throw new RuntimeException(e); } if (bufLen == -1) { return -1; } } return buf[bufOffset++]; } public void skipBlank() { while (next >= 0 && next <= 32) { next = read(); } } public int readInt() { int sign = 1; skipBlank(); if (next == '+' || next == '-') { sign = next == '+' ? 1 : -1; next = read(); } int val = 0; if (sign == 1) { while (next >= '0' && next <= '9') { val = val * 10 + next - '0'; next = read(); } } else { while (next >= '0' && next <= '9') { val = val * 10 - next + '0'; next = read(); } } return val; } public long readLong() { int sign = 1; skipBlank(); if (next == '+' || next == '-') { sign = next == '+' ? 1 : -1; next = read(); } long val = 0; if (sign == 1) { while (next >= '0' && next <= '9') { val = val * 10 + next - '0'; next = read(); } } else { while (next >= '0' && next <= '9') { val = val * 10 - next + '0'; next = read(); } } return val; } public double readDouble() { boolean sign = true; skipBlank(); if (next == '+' || next == '-') { sign = next == '+'; next = read(); } long val = 0; while (next >= '0' && next <= '9') { val = val * 10 + next - '0'; next = read(); } if (next != '.') { return sign ? val : -val; } next = read(); long radix = 1; long point = 0; while (next >= '0' && next <= '9') { point = point * 10 + next - '0'; radix = radix * 10; next = read(); } double result = val + (double) point / radix; return sign ? result : -result; } public String readString(StringBuilder builder) { skipBlank(); while (next > 32) { builder.append((char) next); next = read(); } return builder.toString(); } public String readString() { defaultStringBuf.setLength(0); return readString(defaultStringBuf); } public int readLine(char[] data, int offset) { int originalOffset = offset; while (next != -1 && next != '\n') { data[offset++] = (char) next; next = read(); } return offset - originalOffset; } public int readString(char[] data, int offset) { skipBlank(); int originalOffset = offset; while (next > 32) { data[offset++] = (char) next; next = read(); } return offset - originalOffset; } public int readString(byte[] data, int offset) { skipBlank(); int originalOffset = offset; while (next > 32) { data[offset++] = (byte) next; next = read(); } return offset - originalOffset; } public char readChar() { skipBlank(); char c = (char) next; next = read(); return c; } public void flush() { try { os.write(cache.toString().getBytes(charset)); os.flush(); cache.setLength(0); } catch (IOException e) { throw new RuntimeException(e); } } public boolean hasMore() { skipBlank(); return next != -1; } } public static class Debug { private boolean allowDebug; public Debug(boolean allowDebug) { this.allowDebug = allowDebug; } public void assertTrue(boolean flag) { if (!allowDebug) { return; } if (!flag) { fail(); } } public void fail() { throw new RuntimeException(); } public void assertFalse(boolean flag) { if (!allowDebug) { return; } if (flag) { fail(); } } private void outputName(String name) { System.out.print(name + " = "); } public void debug(String name, int x) { if (!allowDebug) { return; } outputName(name); System.out.println("" + x); } public void debug(String name, long x) { if (!allowDebug) { return; } outputName(name); System.out.println("" + x); } public void debug(String name, double x) { if (!allowDebug) { return; } outputName(name); System.out.println("" + x); } public void debug(String name, int[] x) { if (!allowDebug) { return; } outputName(name); System.out.println(Arrays.toString(x)); } public void debug(String name, long[] x) { if (!allowDebug) { return; } outputName(name); System.out.println(Arrays.toString(x)); } public void debug(String name, double[] x) { if (!allowDebug) { return; } outputName(name); System.out.println(Arrays.toString(x)); } public void debug(String name, Object x) { if (!allowDebug) { return; } outputName(name); System.out.println("" + x); } public void debug(String name, Object... x) { if (!allowDebug) { return; } outputName(name); System.out.println(Arrays.deepToString(x)); } } }
np
1185_G1. Playlist for Polycarp (easy version)
CODEFORCES
import java.io.*; import java.lang.*; public class CF1003E{ public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split(" "); int n = Integer.parseInt(s[0]); int d = Integer.parseInt(s[1]); int k = Integer.parseInt(s[2]); StringBuffer sb = new StringBuffer(); int[] rem = new int[n]; int[] deg = new int[n]; int i = 0; if(k == 1){ if(n <= 2){ }else{ System.out.println("NO"); return; } } for(i=0;i<d;i++){ if(i>=n-1){ System.out.println("NO"); return; } sb.append((i+1) +" " + (i+2)+"\n"); rem[i] = Math.min(i, d-i); deg[i]++; if(i+1<n) deg[i+1]++; } if(i<n){ rem[i] = 0; deg[i] = 1; } i++; int j = 0; for(;i<n;i++){ //For all remaining Nodes while(true){ if(j>=n){ System.out.println("NO"); return; } if(rem[j] > 0 && deg[j]<k){ deg[j]++; rem[i] = rem[j] - 1; sb.append((j+1)+" "+(i+1)+"\n"); deg[i]++; break; }else{ j++; } } } System.out.println("YES"); System.out.println(sb); } }
quadratic
1003_E. Tree Constructing
CODEFORCES
import java.io.*; import java.math.*; import java.util.*; // author @mdazmat9 public class codeforces{ public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int test = 1; for (int ind = 0; ind < test; ind++) { int [] a=new int[3]; a[0]=sc.nextInt(); a[1]=sc.nextInt(); a[2]=sc.nextInt(); Arrays.sort(a); int k1=a[0]; int k2=a[1]; int k3=a[2]; if(k1==1 || k2==1 || k3==1){ out.println("YES"); } else if((k1==2 && k2==2)||(k2==2 && k3==2)){ out.println("YES"); } else if(k1==3 && k2==3 && k3==3){ out.println("YES"); } else if(k1==2 && k2==4 && k3==4){ out.println("YES"); } else out.println("NO"); } out.flush(); } static void shuffle(int[] a) { int n = a.length; for(int i = 0; i < n; i++) { int r = i + (int) (Math.random() * (n - i)); int tmp = a[i]; a[i] = a[r]; a[r] = tmp; } } static long gcd(long a , long b) { if(b == 0) return a; return gcd(b , a % b); } } class Scanner { public BufferedReader reader; public StringTokenizer st; public Scanner(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream)); st = null; } public String next() { while (st == null || !st.hasMoreTokens()) { try { String line = reader.readLine(); if (line == null) return null; st = new StringTokenizer(line); } catch (Exception e) { throw (new RuntimeException()); } } return st.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } } class OutputWriter { BufferedWriter writer; public OutputWriter(OutputStream stream) { writer = new BufferedWriter(new OutputStreamWriter(stream)); } public void print(int i) throws IOException { writer.write(i); } public void print(String s) throws IOException { writer.write(s); } public void print(char[] c) throws IOException { writer.write(c); } public void close() throws IOException { writer.close(); } }
constant
911_C. Three Garlands
CODEFORCES
import java.io.*; import java.math.BigInteger; import java.util.*; public class E implements Runnable { public static void main (String[] args) {new Thread(null, new E(), "_cf", 1 << 28).start();} int n, m; char[] str; int[][] occs, cost; int[] dp; public void run() { FastScanner fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); System.err.println(""); //where's my 420???? :( long tot = 0; for(int i = 0; i < 20000; i++) tot += i; System.err.println(tot); n = fs.nextInt(); m = fs.nextInt(); byte[] str = fs.next().getBytes(); int[] occs = new int[1<<m]; for(int i = 0; i < n-1; i++) { int l1 = str[i] - 'a'; int l2 = str[i+1] - 'a'; occs[(1<<l1) | (1<<l2)]++; occs[(1<<l2) | (1<<l1)]++; } //cost[mask][v] = numPairs with v for some all bits on in mask int all = (1<<m)-1; cost = new int[m][1<<m]; for(int i = 0; i < m; i++) { for(int mask = 1; mask < all; mask++) { if(((1<<i)&mask) > 0) continue; int lb = mask & (-mask); int trail = Integer.numberOfTrailingZeros(lb); int nmask = mask ^ lb; cost[i][mask] = cost[i][nmask]+occs[1<<i | 1<<trail]; } } dp = new int[1<<m]; for(int mask = dp.length-2; mask >= 0; mask--) { int addOn = 0; for(int nxt = 0; nxt < m; nxt++) { if(((1<<nxt)&mask) > 0) continue; addOn += cost[nxt][mask]; } int res = oo; for(int nxt = 0; nxt < m; nxt++) { if(((1<<nxt)&mask) > 0) continue; int ret = addOn+dp[mask | (1<<nxt)]; res = min(res, ret); } dp[mask] = res; } System.out.println(dp[0]>>1); out.close(); } int oo = (int)1e9; int min(int a, int b) { if(a < b) return a; return b; } class FastScanner { public int BS = 1<<16; public char NC = (char)0; byte[] buf = new byte[BS]; int bId = 0, size = 0; char c = NC; double num = 1; BufferedInputStream in; public FastScanner() { in = new BufferedInputStream(System.in, BS); } public FastScanner(String s) { try { in = new BufferedInputStream(new FileInputStream(new File(s)), BS); } catch (Exception e) { in = new BufferedInputStream(System.in, BS); } } public char nextChar(){ while(bId==size) { try { size = in.read(buf); }catch(Exception e) { return NC; } if(size==-1)return NC; bId=0; } return (char)buf[bId++]; } public int nextInt() { return (int)nextLong(); } public long nextLong() { num=1; boolean neg = false; if(c==NC)c=nextChar(); for(;(c<'0' || c>'9'); c = nextChar()) { if(c=='-')neg=true; } long res = 0; for(; c>='0' && c <='9'; c=nextChar()) { res = (res<<3)+(res<<1)+c-'0'; num*=10; } return neg?-res:res; } public double nextDouble() { double cur = nextLong(); return c!='.' ? cur:cur+nextLong()/num; } public String next() { StringBuilder res = new StringBuilder(); while(c<=32)c=nextChar(); while(c>32) { res.append(c); c=nextChar(); } return res.toString(); } public String nextLine() { StringBuilder res = new StringBuilder(); while(c<=32)c=nextChar(); while(c!='\n') { res.append(c); c=nextChar(); } return res.toString(); } public boolean hasNext() { if(c>32)return true; while(true) { c=nextChar(); if(c==NC)return false; else if(c>32)return true; } } public int[] nextIntArray(int n) { int[] res = new int[n]; for(int i = 0; i < n; i++) res[i] = nextInt(); return res; } } }
np
1238_E. Keyboard Purchase
CODEFORCES
import java.awt.Point; import java.io.*; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; import static java.lang.Math.*; public class Start { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); void init() throws FileNotFoundException { if (ONLINE_JUDGE) { in = new BufferedReader(new InputStreamReader(System.in)); out = new PrintWriter(System.out); } else { in = new BufferedReader(new FileReader("input.txt")); out = new PrintWriter("output.txt"); } } String readString() throws IOException { while (!tok.hasMoreTokens()) { tok = new StringTokenizer(in.readLine()); } return tok.nextToken(); } int readInt() throws IOException { return Integer.parseInt(readString()); } long readLong() throws IOException { return Long.parseLong(readString()); } double readDouble() throws IOException { return Double.parseDouble(readString()); } public static void main(String[] args) { new Start().run(); } public static void mergeSort(int[] a) { mergeSort(a, 0, a.length - 1); } private static void mergeSort(int[] a, int levtIndex, int rightIndex) { final int MAGIC_VALUE = 50; if (levtIndex < rightIndex) { if (rightIndex - levtIndex <= MAGIC_VALUE) { insertionSort(a, levtIndex, rightIndex); } else { int middleIndex = (levtIndex + rightIndex) / 2; mergeSort(a, levtIndex, middleIndex); mergeSort(a, middleIndex + 1, rightIndex); merge(a, levtIndex, middleIndex, rightIndex); } } } private static void merge(int[] a, int levtIndex, int middleIndex, int rightIndex) { int length1 = middleIndex - levtIndex + 1; int length2 = rightIndex - middleIndex; int[] levtArray = new int[length1]; int[] rightArray = new int[length2]; System.arraycopy(a, levtIndex, levtArray, 0, length1); System.arraycopy(a, middleIndex + 1, rightArray, 0, length2); for (int k = levtIndex, i = 0, j = 0; k <= rightIndex; k++) { if (i == length1) { a[k] = rightArray[j++]; } else if (j == length2) { a[k] = levtArray[i++]; } else { a[k] = levtArray[i] <= rightArray[j] ? levtArray[i++] : rightArray[j++]; } } } private static void insertionSort(int[] a, int levtIndex, int rightIndex) { for (int i = levtIndex + 1; i <= rightIndex; i++) { int current = a[i]; int j = i - 1; while (j >= levtIndex && a[j] > current) { a[j + 1] = a[j]; j--; } a[j + 1] = current; } } public void run() { try { long t1 = System.currentTimeMillis(); init(); solve(); out.close(); long t2 = System.currentTimeMillis(); System.err.println("Time = " + (t2 - t1)); } catch (Exception e) { e.printStackTrace(System.err); System.exit(-1); } } class Lol implements Comparable<Lol>{ int x; int y; public Lol (int x , int y){ this.x = x; this.y = y; } @Override public int compareTo(Lol arg0) { if (arg0.x == x) { return y-arg0.y; } return arg0.x-x; } } public void solve() throws IOException { int n = readInt(); int k = readInt(); k--; Lol [] a = new Lol [n]; for (int i = 0 ; i <n; i++){ int x = readInt(); int y = readInt(); a[i] = new Lol(x, y); } Arrays.sort(a); int ans = 1; for (int i =k+1; i>-1; i++){ if (i==n) break; if (a[i].x==a[k].x && a[i].y == a[k].y){ ans++; } else break; } if (k!=0){ for (int i =k-1; i>=0; i--){ if (a[i].x==a[k].x && a[i].y == a[k].y){ ans++; } else break; } } out.print(ans); } }
nlogn
166_A. Rank List
CODEFORCES
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main { static int n, k; public static void main(String[] args) throws IOException { FastScanner sc = new FastScanner(); PrintWriter pw = new PrintWriter(System.out); n = sc.nextInt(); k = sc.nextInt(); long l = 0; long r = n + 1; while (l + 1 != r) { long m = (r + l) / 2; if (check(m)) l = m; else r = m; } pw.print(l * (l + 1L) / 2L - k); pw.close(); } public static boolean check(long m) { return m * (m + 1) / 2 - (n - m) <= k; } } class FastScanner { static BufferedReader br; static StringTokenizer st = new StringTokenizer(""); public FastScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } public String next() throws IOException { while (!st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } public int nextInt() throws IOException { return Integer.parseInt(next()); } }
logn
1195_B. Sport Mafia
CODEFORCES
import java.io.*; import java.util.*; public class A { BufferedReader in; StringTokenizer st; PrintWriter out; String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(in.readLine()); return st.nextToken(); } int nextInt() throws Exception { return Integer.parseInt(next()); } long nextLong() throws Exception { return Long.parseLong(next()); } double nextDouble() throws Exception { return Double.parseDouble(next()); } void solve() throws Exception { // int min = 1; // int max = 1000000000; int n = nextInt(); int a[] = new int[n]; for (int i = 0; i < n; i++) a[i] = nextInt(); Arrays.sort(a); if (a[n - 1] == 1) { for (int i = 1; i < n; i++) out.print("1 "); out.print(2); return; } // a[0]=max; Arrays.sort(a); out.print(1); for (int i = 1; i < n; i++) out.print(" " + a[i-1]); } void run() { try { Locale.setDefault(Locale.US); boolean oj = System.getProperty("ONLINE_JUDGE") != null; Reader reader = oj ? new InputStreamReader(System.in) : new FileReader("input.txt"); Writer writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("output.txt"); in = new BufferedReader(reader); out = new PrintWriter(writer); solve(); out.close(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } } public static void main(String[] args) { new A().run(); } }
nlogn
135_A. Replacement
CODEFORCES
import java.io.*; import java.util.*; /** * Road to 1600 raiting */ public class Main { static class Task { PrintWriter out; int[] num = new int[3]; public void solve(MyScanner in, PrintWriter out) { this.out = out; long n = in.nextLong(); long s = in.nextLong(); long l = 1; long r = n; while (r - l > 5) { long x = (l + r) / 2; long ans = ans(x); if (ans >= s) { r = x; } else { l = x; } } for (long i = l; i <= r; i++) { if (ans(i) >= s) { out.println((n - i + 1)); return; } } out.println(0); } long ans(long n) { long res = n; while (n > 9) { res -= n % 10; n /= 10; } res -= n; return res; } } public static void main(String[] args) { MyScanner in = new MyScanner(); PrintWriter out = new PrintWriter(System.out); Task solver = new Task(); solver.solve(in, out); out.close(); } public static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
logn
817_C. Really Big Numbers
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; /** * Author - * User: kansal * Date: 9/3/11 * Time: 5:28 PM */ public class CF85E { public static void main(String[] args) { reader = new BufferedReader(new InputStreamReader(System.in)); int height = nextInt(), width = nextInt(); if (width > height) { int t = width; width = height; height = t; } final int INF = height * width + 10; int[][][] dp = new int[height + 1][1 << width][1 << width]; for (int[][] ints : dp) { for (int[] anInt : ints) { Arrays.fill(anInt, INF); } } dp[0][0][0] = 0; for(int r = 0; r < height; ++r) { for(int uncovered = 0; uncovered < (1 << width); ++uncovered) { for(int mask = 0; mask < (1 << width); ++mask) { if (dp[r][uncovered][mask] == INF) { continue; } for(int curMask = uncovered; curMask < (1 << width); curMask = (curMask + 1) | uncovered) { int curUncovered = (1 << width) - 1; for(int i = 0; i < width; ++i) { if (hasBit(mask, i) || hasBit(curMask, i)) { curUncovered &= ~(1 << i); } if (i > 0 && hasBit(curMask, i-1)) { curUncovered &= ~(1 << i); } if (i < width-1 && hasBit(curMask, i+1)) { curUncovered &= ~(1 << i); } } dp[r+1][curUncovered][curMask] = Math.min(dp[r+1][curUncovered][curMask], dp[r][uncovered][mask] + Integer.bitCount(curMask)); } } } } int res = INF; for(int x: dp[height][0]) res = Math.min(res, x); System.out.println(height * width - res); } private static boolean hasBit(int mask, int bit) { return (((mask >> bit) & 1) == 1); } public static BufferedReader reader; public static StringTokenizer tokenizer = null; static String nextToken() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } static public int nextInt() { return Integer.parseInt(nextToken()); } static public long nextLong() { return Long.parseLong(nextToken()); } static public String next() { return nextToken(); } static public String nextLine() { try { return reader.readLine(); } catch (IOException e) { e.printStackTrace(); } return null; } }
np
112_E. Petya and Spiders
CODEFORCES
import java.io.*; import java.math.BigInteger; import java.util.*; public class Watermelon { static int[][] ans;static int n,m;static boolean[][] vis; public static void main(String[] args) throws IOException { Scanner sc=new Scanner(new File("input.txt")); // Scanner sc=new Scanner(System.in); PrintWriter pw=new PrintWriter("output.txt"); int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt(); Queue<Integer> pq=new ArrayDeque<>(); boolean[] vis=new boolean[n*m]; for(int i=0;i<k;i++){ int r=sc.nextInt()-1,c=sc.nextInt()-1; pq.add(m*r+c); vis[m*r+c]=true; } sc.close(); int ans=0; while(pq.size()!=0){ int x=pq.remove(); ans=x; if(n!=1 && x%n==0){ if(x+m<n*m&&!vis[x+m]){ pq.add(x+m); vis[x+m]=true; } if(x-m>=0&&!vis[x-m]){ pq.add(x-m); vis[x-m]=true; } if(x+1<n*m&&!vis[x+1]){ pq.add(x+1); vis[x+1]=true; } } else if(n!=1 && (x+1)%n==0){ if(x+m<n*m&&!vis[x+m]){ pq.add(x+m); vis[x+m]=true; } if(x-m>=0&&!vis[x-m]){ pq.add(x-m); vis[x-m]=true; } if(x-1>=0&&!vis[x-1]){ pq.add(x-1); vis[x-1]=true; } } else{ if(x+m<n*m&&!vis[x+m]){ pq.add(x+m); vis[x+m]=true; } if(x-m>=0&&!vis[x-m]){ pq.add(x-m); vis[x-m]=true; } if(x-1>=0&&!vis[x-1]){ pq.add(x-1); vis[x-1]=true; } if(x+1<n*m&&!vis[x+1]){ pq.add(x+1); vis[x+1]=true; } } } pw.println((ans/m+1)+" "+(ans%m+1)); pw.close(); } static class Reader{ final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { din = new DataInputStream(System.in); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public Reader(String file_name) throws IOException { din = new DataInputStream(new FileInputStream(file_name)); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public String readLine() throws IOException { byte[] buf = new byte[64]; // line length int cnt = 0, c; while ((c = read()) != -1) { if (c == '\n') break; buf[cnt++] = (byte) c; } return new String(buf, 0, cnt); } public int nextInt() throws IOException { int ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public long nextLong() throws IOException { long ret = 0; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (neg) return -ret; return ret; } public double nextDouble() throws IOException { double ret = 0, div = 1; byte c = read(); while (c <= ' ') c = read(); boolean neg = (c == '-'); if (neg) c = read(); do { ret = ret * 10 + c - '0'; } while ((c = read()) >= '0' && c <= '9'); if (c == '.') { while ((c = read()) >= '0' && c <= '9') { ret += (c - '0') / (div *= 10); } } if (neg) return -ret; return ret; } private void fillBuffer() throws IOException { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); if (bytesRead == -1) buffer[0] = -1; } private byte read() throws IOException { if (bufferPointer == bytesRead) fillBuffer(); return buffer[bufferPointer++]; } public void close() throws IOException { if (din == null) return; din.close(); } } }
cubic
35_C. Fire Again
CODEFORCES
import java.util.*; public class Main { final int INF = Integer.MAX_VALUE / 2; private void doit(){ Scanner sc = new Scanner(System.in); //while(sc.hasNext()){ int n = sc.nextInt(); if(n == 0){ System.out.println("0 0 0"); } else if(n == 1){ System.out.println("0 0 1"); } else{ //create a fib ArrayList<Integer> fibList = new ArrayList<Integer>(); int pre = 0; int next = 1; fibList.add(pre); fibList.add(next); while(next != n){ int temp = next; next +=pre; fibList.add(next); pre = temp; } int len = fibList.size(); int a = fibList.get(len-4); int b = fibList.get(len-3); int c = fibList.get(len-3); System.out.println(a + " " + b + " " + c); } //} } public static void main(String[] args) { Main obj = new Main(); obj.doit(); } }
constant
199_A. Hexadecimal's theorem
CODEFORCES
import java.util.Scanner; public class R025A { int n; int[] nums; public R025A() { Scanner scanner = new Scanner(System.in); n = scanner.nextInt(); nums = new int[n]; for(int i=0; i<n; i++) { nums[i] = scanner.nextInt(); } } private void process() { int[] c = new int[2]; int[] r = new int[2]; for(int i=0; i<n; i++) { c[nums[i] % 2]++; if(r[nums[i] %2] == 0) { r[nums[i] % 2] = i+1; } } System.out.println(r[c[0]==1 ? 0 : 1]); } public static void main(String[] args) { new R025A().process(); } }
linear
25_A. IQ test
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class CodeForces1177B { public static char custBinSearch(long lower, long upper, long lowIndex, int ten, long position) { long half = Math.round((lower + upper) / 2.0); long lowBound = lowIndex + (half - lower)*(ten + 1); long upBound = lowBound + ten; if(position < lowBound) { //Less than the lowest index of half return custBinSearch(lower, half - 1, lowIndex, ten, position); } else if (position > upBound) { //Remember to update lowIndex here. lowIndex += (half + 1 - lower)*(ten + 1); return custBinSearch(half + 1, upper, lowIndex, ten, position); } else { return Long.toString(half).charAt((int) (position - lowBound)); //The final number will at max be 11 characters long, thus it is safe to convert and cast. } } public static void main(String[] args) throws IOException { BufferedReader inputs = new BufferedReader(new InputStreamReader(System.in)); long indexPosition = Long.parseLong(inputs.readLine()); inputs.close(); //Isolate possible combinations so that all further numbers will have the same length. int tenFactor = 0; long lowerBound = 1; long upperBound = (long) (Math.pow(10, 12)); long lowerIndexBound = 1; long redIndex = 0; redIndex += indexPosition; while(redIndex > 0) { redIndex -= (long) (9*Math.pow(10, tenFactor)*(tenFactor + 1)); if(redIndex <= 0) { //Stage 1: Completed Successfully. lowerBound = (long) (Math.pow(10, tenFactor)); upperBound = (long) (Math.pow(10, tenFactor + 1) - 1); break; } lowerIndexBound += (long) (9*Math.pow(10, tenFactor)*(tenFactor + 1)); tenFactor++; } System.out.println(custBinSearch(lowerBound, upperBound, lowerIndexBound, tenFactor, indexPosition)); } }
logn
1177_B. Digits Sequence (Hard Edition)
CODEFORCES
//package codeforces.br22; import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; /** * User: Kandy * Date: 29.06.2010 * Time: 21:07:24 */ public class ProblemA { public void solve() { boolean oj = true; try { Reader reader = oj ? new InputStreamReader(System.in) : new FileReader("A.in"); Writer writer = oj ? new OutputStreamWriter(System.out) : new FileWriter("A.out"); BufferedReader br = new BufferedReader(reader); StreamTokenizer st = new StreamTokenizer(reader); PrintWriter out = new PrintWriter(writer); MyTokenizer tok = new MyTokenizer(br.readLine()); int n = (int)tok.getNum(); tok =new MyTokenizer(br.readLine()); List<Integer> a = new ArrayList<Integer>(); for(int i=0;i<n;i++) { int r = (int)tok.getNum(); if (!a.contains(r)) { a.add(r); } } Collections.sort(a); if (a.size() < 2) { out.printf("NO"); } else { out.printf("%d", a.get(1)); } br.close(); out.close(); reader.close(); writer.close(); } catch (Exception ex) { ex.printStackTrace(); } finally { } } public static void main(String[] args) { ProblemA f = new ProblemA(); f.solve(); } private class MyTokenizer { private String s; private int cur; public MyTokenizer(String s) { this.s = s; cur = 0; } public void skip() { while (cur < s.length() && (s.charAt(cur) == ' ' || s.charAt(cur) == '\n')) { cur++; } } public double getNum() { skip(); String snum = ""; while (cur < s.length() && (s.charAt(cur) >= '0' && s.charAt(cur) <= '9' || s.charAt(cur) == '.' || s.charAt(cur) == '-')) { snum += s.charAt(cur); cur++; } return Double.valueOf(snum); } public String getString() { skip(); String s2 = ""; while (cur < s.length() && (((s.charAt(cur) >= 'a' && s.charAt(cur) <= 'z')) || ((s.charAt(cur) >= 'A' && s.charAt(cur) <= 'Z')))) { s2 += s.charAt(cur); cur++; } return s2; } public char getCurrentChar() throws Exception { if (cur < s.length()) return s.charAt(cur); else throw new Exception("Current character out of string length"); } public void moveNextChar() { if (cur < s.length()) cur++; } public boolean isFinished() { return cur >= s.length(); } } }
nlogn
22_A. Second Order Statistics
CODEFORCES
import java.util.*; public class Etruco2 { static String[] vals = { "%S3L{PYzV1%SGI'>$/4Gam=^#ODu|`Q!Bys%Mw|?fA*0ti{r69RB1N`{B>YC;.:XEmm3t-i^N", "#Y73mVxQ&J`inFO4.v<j?yg{4~O=p=t$'#UHQizDnbsn,+JyuS~@WKw0p*Gy%V:#sa5,L|9RX{", "f0J*n]5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[]^_`abcdefghijklmnopqrstuvwxyz{|}~"; static int N = 400; static long mod; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); long b = chars.length(); int n = sc.nextInt(); mod = sc.nextLong(); if(n > 110) { char[] s = vals[n-111].toCharArray(); long res = 0; for(char c: s) { res *= b; res += chars.indexOf(c); res %= mod; } System.out.println(res); } else { c = new long[N+1][N+1]; c[0][0] = 1; for(int i = 0; i < n; i++){ c[i][0] = 1; for(int j = 1; j <= i; j++){ c[i][j] = (c[i-1][j] + c[i-1][j-1]) % mod; } } dpcl = new long[N+1][N+1]; dpop = new long[N+1][N+1]; for(int i = 0; i <= N; i++){ for(int j = 0; j <= N; j++){ dpcl[i][j] = -1; dpop[i][j] = -1; } } long res = 0; for(int i = 0; i < n; i++){ for(int j = 0; j <= n-1; j++){ for(int a = 0; a <= j; a++) { long leftv = dpop(i, a); long rightv = dpop(n-i-1, j-a); long curr = leftv * rightv % mod; long fac = c[j][a]; long v = curr * fac % mod; res = (res + v) % mod; } } } System.out.println(res); } } static long[][] c, dpcl, dpop; static long dpcl(int n, int k) { if(dpcl[n][k] >= 0) return dpcl[n][k]; if(n == 0 || n == 1) { if(k == 0) { return dpcl[n][k] = 1; } else { return dpcl[n][k] = 0; } } if(k == 0) { // n > 1 return dpcl[n][k] = 0; } long res = 0; for(int i = 0; i < n; i++){ for(int a = 0; a <= k-1; a++) { long leftv = dpcl(i, a); long rightv = dpcl(n-i-1, k-1-a); long curr = leftv * rightv % mod; long fac = c[k-1][a]; long v = curr * fac % mod; res = (res + v) % mod; } } return dpcl[n][k] = res; } static long dpop(int n, int k) { if(dpop[n][k] >= 0) return dpop[n][k]; if(n == 0) { if(k == 0) { return dpop[n][k] = 1; } else { return dpop[n][k] = 0; } } if(k == 0) { // n > 0 return dpop[n][k] = 0; } long res = 0; for(int i = 0; i < n; i++){ for(int a = 0; a <= k-1; a++) { long leftv = dpcl(i, a); long rightv = dpop(n-i-1, k-1-a); long curr = leftv * rightv % mod; long fac = c[k-1][a]; long v = curr * fac % mod; res = (res + v) % mod; } } return dpop[n][k] = res; } }
cubic
1515_E. Phoenix and Computers
CODEFORCES
import java.io.*; import java.math.*; import java.util.*; public class Main { InputReader input; PrintWriter output; void run(){ output = new PrintWriter(new OutputStreamWriter(System.out)); input = new InputReader(System.in); solve(); output.flush(); } public static void main(String[] args){ new Main().run(); } boolean isBitSet(int mask, int i) { return (mask&(1<<i)) != 0; } int unSet(int mask, int i) { return mask & ~(1<<i); } void solve() { int n = input.ni(); double[][] prb = new double[n][n]; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { prb[i][j] = input.readDouble(); } } double[] dp = new double[1<<n]; dp[0] = 1.0; for(int i = 0; i < 1<<n; i++) { int remaining = n-Integer.bitCount(i); double remainingProbability = remaining*(remaining-1)/2; for(int j = 0; j < n; j++) { if(!isBitSet(i, j)) { //jth fish is alive for(int k = 0; k < n; k++) { //candidates to kill jth fish if(!isBitSet(i, k)) dp[i|(1<<j)] += dp[i]*prb[k][j]/(remainingProbability); } } } } for(int i = 0; i < n; i++) { output.printf("%.7f ",dp[unSet((1<<n)-1, i)]); } output.println(); } class InputReader { private boolean finished = false; private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; private SpaceCharFilter filter; public InputReader(InputStream stream) { this.stream = stream; } public int read() { if (numChars == -1) throw new InputMismatchException(); if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars <= 0) return -1; } return buf[curChar++]; } public int peek() { if (numChars == -1) return -1; if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { return -1; } if (numChars <= 0) return -1; } return buf[curChar]; } public int ni() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } int res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public long nl() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } long res = 0; do { if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } while (!isSpaceChar(c)); return res * sgn; } public String ns() { int c = read(); while (isSpaceChar(c)) c = read(); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = read(); } while (!isSpaceChar(c)); return res.toString(); } public boolean isSpaceChar(int c) { if (filter != null) return filter.isSpaceChar(c); return isWhitespace(c); } public boolean isWhitespace(int c) { return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1; } private String readLine0() { StringBuilder buf = new StringBuilder(); int c = read(); while (c != '\n' && c != -1) { if (c != '\r') buf.appendCodePoint(c); c = read(); } return buf.toString(); } public String readLine() { String s = readLine0(); while (s.trim().length() == 0) s = readLine0(); return s; } public String readLine(boolean ignoreEmptyLines) { if (ignoreEmptyLines) return readLine(); else return readLine0(); } public BigInteger readBigInteger() { try { return new BigInteger(ns()); } catch (NumberFormatException e) { throw new InputMismatchException(); } } public char readCharacter() { int c = read(); while (isSpaceChar(c)) c = read(); return (char) c; } public double readDouble() { int c = read(); while (isSpaceChar(c)) c = read(); int sgn = 1; if (c == '-') { sgn = -1; c = read(); } double res = 0; while (!isSpaceChar(c) && c != '.') { if (c == 'e' || c == 'E') return res * Math.pow(10, ni()); if (c < '0' || c > '9') throw new InputMismatchException(); res *= 10; res += c - '0'; c = read(); } if (c == '.') { c = read(); double m = 1; while (!isSpaceChar(c)) { if (c == 'e' || c == 'E') return res * Math.pow(10, ni()); if (c < '0' || c > '9') throw new InputMismatchException(); m /= 10; res += (c - '0') * m; c = read(); } } return res * sgn; } public boolean eof() { int value; while (isSpaceChar(value = peek()) && value != -1) read(); return value == -1; } public String next() { return ns(); } public SpaceCharFilter getFilter() { return filter; } public void setFilter(SpaceCharFilter filter) { this.filter = filter; } } public interface SpaceCharFilter { public boolean isSpaceChar(int ch); } }
np
16_E. Fish
CODEFORCES
// upsolve with rainboy import java.io.*; import java.util.*; public class CF1187G extends PrintWriter { CF1187G() { super(System.out); } static class Scanner { Scanner(InputStream in) { this.in = in; } InputStream in; int k, l; byte[] bb = new byte[1 << 15]; byte getc() { if (k >= l) { k = 0; try { l = in.read(bb); } catch (IOException e) { l = 0; } if (l <= 0) return -1; } return bb[k++]; } int nextInt() { byte c = 0; while (c <= 32) c = getc(); int a = 0; while (c > 32) { a = a * 10 + c - '0'; c = getc(); } return a; } } Scanner sc = new Scanner(System.in); public static void main(String[] $) { CF1187G o = new CF1187G(); o.main(); o.flush(); } static final int INF = 0x3f3f3f3f; ArrayList[] aa_; int n_, m_; int[] pi, kk, bb; int[] uu, vv, uv, cost, cost_; int[] cc; void init() { aa_ = new ArrayList[n_]; for (int u = 0; u < n_; u++) aa_[u] = new ArrayList<Integer>(); pi = new int[n_]; kk = new int[n_]; bb = new int[n_]; uu = new int[m_]; vv = new int[m_]; uv = new int[m_]; cost = new int[m_]; cost_ = new int[m_]; cc = new int[m_ * 2]; m_ = 0; } void link(int u, int v, int cap, int cos) { int h = m_++; uu[h] = u; vv[h] = v; uv[h] = u ^ v; cost[h] = cos; cc[h << 1 ^ 0] = cap; aa_[u].add(h << 1 ^ 0); aa_[v].add(h << 1 ^ 1); } void dijkstra(int s) { Arrays.fill(pi, INF); pi[s] = 0; TreeSet<Integer> pq = new TreeSet<>((u, v) -> pi[u] != pi[v] ? pi[u] - pi[v] : kk[u] != kk[v] ? kk[u] - kk[v] : u - v); pq.add(s); Integer first; while ((first = pq.pollFirst()) != null) { int u = first; int k = kk[u] + 1; ArrayList<Integer> adj = aa_[u]; for (int h_ : adj) if (cc[h_] > 0) { int h = h_ >> 1; int p = pi[u] + ((h_ & 1) == 0 ? cost_[h] : -cost_[h]); int v = u ^ uv[h]; if (pi[v] > p || pi[v] == p && kk[v] > k) { if (pi[v] < INF) pq.remove(v); pi[v] = p; kk[v] = k; bb[v] = h_; pq.add(v); } } } } void push(int s, int t) { int c = INF; for (int u = t, h_, h; u != s; u ^= uv[h]) { h = (h_ = bb[u]) >> 1; c = Math.min(c, cc[h_]); } for (int u = t, h_, h; u != s; u ^= uv[h]) { h = (h_ = bb[u]) >> 1; cc[h_] -= c; cc[h_ ^ 1] += c; } } void push1(int s, int t) { for (int u = t, h_, h; u != s; u ^= uv[h]) { h = (h_ = bb[u]) >> 1; cc[h_]--; cc[h_ ^ 1]++; } } int edmonds_karp(int s, int t) { System.arraycopy(cost, 0, cost_, 0, m_); while (true) { dijkstra(s); if (pi[t] == INF) break; push1(s, t); for (int h = 0; h < m_; h++) { int u = uu[h], v = vv[h]; if (pi[u] != INF && pi[v] != INF) cost_[h] += pi[u] - pi[v]; } } int c = 0; for (int h = 0; h < m_; h++) c += cost[h] * cc[h << 1 ^ 1]; return c; } void main() { int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt(); int c = sc.nextInt(); int d = sc.nextInt(); int[] ii = new int[k]; for (int h = 0; h < k; h++) ii[h] = sc.nextInt() - 1; ArrayList[] aa = new ArrayList[n]; for (int i = 0; i < n; i++) aa[i] = new ArrayList<Integer>(); for (int h = 0; h < m; h++) { int i = sc.nextInt() - 1; int j = sc.nextInt() - 1; aa[i].add(j); aa[j].add(i); } int t = n + k + 1; n_ = n * t + 1; m_ = k + (m * 2 * k + n) * (t - 1); init(); for (int i = 0; i < n; i++) { ArrayList<Integer> adj = aa[i]; for (int s = 0; s < t - 1; s++) { int u = i * t + s; for (int j : adj) { int v = j * t + s + 1; for (int x = 1; x <= k; x++) link(u, v, 1, c + (x * 2 - 1) * d); } } } for (int i = 0; i < n; i++) for (int s = 0; s < t - 1; s++) { int u = i * t + s, v = u + 1; link(u, v, k, i == 0 ? 0 : c); } for (int h = 0; h < k; h++) link(n_ - 1, ii[h] * t + 0, 1, 0); println(edmonds_karp(n_ - 1, 0 * t + t - 1)); } }
cubic
1187_G. Gang Up
CODEFORCES
import java.util.*; public class LCMChallenge { public static void main(String[] args) { Scanner in = new Scanner(System.in); long n = in.nextInt(); if(n == 1l) System.out.println(1); else if(n == 2l) System.out.println(2); else { long c1 = n*(n-1)*(n-2); long c2 = n*(n-1)*(n-3); long c3 = (n-1)*(n-2)*(n-3); if(n%2==0) c1/=2; else c3/=2; if(n%3==0) c2/=3; long ans = Math.max(c1, c2); ans = Math.max(ans, c3); System.out.println(ans); } } }
constant
235_A. LCM Challenge
CODEFORCES
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test3 { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int x=Integer.parseInt(br.readLine()); int y=Integer.parseInt(br.readLine()); System.out.print((int)(y%(Math.pow(2, x)))); } }
constant
913_A. Modular Exponentiation
CODEFORCES
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.util.HashMap; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; 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 = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); OnTheBench solver = new OnTheBench(); solver.solve(1, in, out); out.close(); } static class OnTheBench { long MOD = (long) (1e9) + 7; long[][] C = new long[333][333]; public void solve(int testNumber, InputReader in, PrintWriter out) { int N = in.nextInt(); DisjointSet dsu = new DisjointSet(N); long[] arr = new long[N]; setC(); for (int i = 0; i < N; i++) { arr[i] = in.nextInt(); } for (int i = 0; i < N; i++) { for (int j = i + 1; j < N; j++) { long sqrt = (long) (Math.sqrt(arr[i] * arr[j])); long sqrt2 = (long) (Math.ceil(Math.sqrt(arr[i] * arr[j]))); if (sqrt * sqrt == arr[i] * arr[j] || sqrt2 * sqrt2 == arr[i] * arr[j]) { dsu.merge(i, j); } } } ArrayList<Integer> sz = new ArrayList<>(); sz.add(0); HashMap<Integer, Integer> seen = new HashMap<>(); long mult = 1; for (int i = 0; i < N; i++) { if (!seen.containsKey(dsu.find(i))) { seen.put(dsu.find(i), sz.size()); sz.add(0); } sz.set(seen.get(dsu.find(i)), sz.get(seen.get(dsu.find(i))) + 1); } for (int i : sz) { // if (arr[0] == 285) { // out.println(i); // } mult *= fact(i); mult %= MOD; } long[][] dp = new long[sz.size()][333]; int sum = 0; dp[0][0] = 1; for (int n = 1; n < dp.length; n++) { for (int ij = 1; ij <= sz.get(n); ij++) { for (int y = 0; y <= sum; y++) { for (int j = 0; j <= Math.min(y, ij); j++) { int i = ij - j; dp[n][y - j + sz.get(n) - ij] += ((((dp[n - 1][y] * C[sum + 1 - y][i]) % MOD * C[y][j]) % MOD) * C[sz.get(n) - 1][ij - 1]) % MOD; dp[n][y - j + sz.get(n) - ij] %= MOD; } } } sum += sz.get(n); } out.println((dp[sz.size() - 1][0] * mult) % MOD); } void setC() { for (int i = 0; i <= 332; i++) { C[i][0] = 1; for (int j = 1; j <= i; j++) { C[i][j] = C[i - 1][j] + C[i - 1][j - 1]; C[i][j] %= MOD; } } } long fact(int i) { long res = 1; while (i > 0) { res *= i; res %= MOD; i--; } return res; } } static class InputReader { public BufferedReader reader; public StringTokenizer tokenizer; public InputReader(InputStream stream) { reader = new BufferedReader(new InputStreamReader(stream), 32768); tokenizer = null; } public String next() { while (tokenizer == null || !tokenizer.hasMoreTokens()) { try { tokenizer = new StringTokenizer(reader.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return tokenizer.nextToken(); } public int nextInt() { return Integer.parseInt(next()); } } static class DisjointSet { int[] rank; int[] par; public DisjointSet(int N) { rank = new int[N]; par = new int[N]; for (int i = 0; i < N; i++) { rank[i] = 1; par[i] = i; } } public int find(int x) { if (x == par[x]) { return x; } return (par[x] = find(par[x])); } public void merge(int x, int y) { int parX = find(x); int parY = find(y); if (parX != parY) { if (rank[parX] > rank[parY]) { par[parY] = parX; rank[parX] += rank[parY]; } else { par[parX] = parY; rank[parY] += rank[parX]; } } } } }
cubic
840_C. On the Bench
CODEFORCES
import java.io.*; import java.util.*; import static java.lang.Math.*; public class E { static int g[][]; static int n, m; static char[] s; static int dp[], inf = (int) 2e9; public static void main(String[] args) throws Exception { Scanner in = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); n = in.nextInt(); m = in.nextInt(); s = in.next().toCharArray(); g = new int[m][m]; for (int i = 1; i < n; i++) { int x = s[i - 1] - 'a', y = s[i] - 'a'; if (x != y) { g[x][y]++; g[y][x]++; } } dp = new int[1 << m]; Arrays.fill(dp, -1); pw.println(solve(0, 0)); pw.close(); } static int solve(int pos, int mask) { if (pos >= m) return 0; if (dp[mask] != -1) return dp[mask]; int min = inf; for (int i = 0; i < m; i++) { if (!check(mask, i)) { int res = 0; for (int j = 0; j < m; j++) { if (check(mask, j)) res += g[i][j] * pos; else res -= g[i][j] * pos; } res += solve(pos + 1, set(mask, i)); min = min(min, res); } } return dp[mask] = min; } static boolean check(int N, int pos) { return (N & (1 << pos)) != 0; } static int set(int N, int pos) { return N = N | (1 << pos); } static int reset(int N, int pos) { return N = N & ~(1 << pos); } static void debug(Object... obj) { System.err.println(Arrays.deepToString(obj)); } }
np
1238_E. Keyboard Purchase
CODEFORCES
import java.io.*; import java.util.*; import java.math.*; import java.util.regex.*; /** * * @author jon */ public class Fish { double memo[] = new double[(1<<18)]; int N, FULL; double prob[][] = new double[18][18]; Fish() { Scanner in = new Scanner(System.in); Arrays.fill(memo, -1); N = in.nextInt(); FULL = (1<<N) - 1; for(int i = 0; i < N; i++) { for(int j = 0; j < N; j++) { prob[i][j] = in.nextDouble(); } } for(int i = 0; i < N; i++) { System.out.printf("%.6f ", go((1<<i))); } System.out.println(); } public double go(int mask) { if(mask == FULL) return 1.0; if(memo[mask] >= 0) return memo[mask]; double ret = 0; double mult = Integer.bitCount(mask) + 1; mult *= (mult-1)/2.0; for(int i = 0; i < N; i++) { if(((1<<i) & mask) != 0) { for(int j = 0; j < N; j++) { if(((1<<j) & mask) == 0) { ret += go(mask | (1<<j)) * prob[i][j]; } } } } ret /= mult; memo[mask] = ret; return ret; } public static void main(String args[]) { new Fish(); } }
np
16_E. Fish
CODEFORCES
import java.util.*; public class helloWorld { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int b = in.nextInt(); int c = in.nextInt(); int n = in.nextInt(); int ans = n - (a + b - c); if(ans < 1 || a >= n || b >= n || c > a || c > b) ans = -1; System.out.println(ans); in.close(); } }
constant
991_A. If at first you don't succeed...
CODEFORCES
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.StringTokenizer; public class cf2 { static final double EPS = 1e-9; public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); //rec int xr1=sc.nextInt(), yr1=sc.nextInt(), xr2=sc.nextInt(),yr2=sc.nextInt(); int xr3=sc.nextInt(), yr3=sc.nextInt(), xr4=sc.nextInt(),yr4=sc.nextInt(); Point pr1 = new Point(xr1, yr1); Point pr2 = new Point(xr2, yr2); Point pr3 = new Point(xr3, yr3); Point pr4 = new Point(xr4, yr4); LineSegment lr1 = new LineSegment(pr1, pr2); LineSegment lr2 = new LineSegment(pr2, pr3); LineSegment lr3 = new LineSegment(pr3, pr4); LineSegment lr4 = new LineSegment(pr4, pr1); //diamond int xd1=sc.nextInt(), yd1=sc.nextInt(), xd2=sc.nextInt(),yd2=sc.nextInt(); int xd3=sc.nextInt(), yd3=sc.nextInt(), xd4=sc.nextInt(),yd4=sc.nextInt(); Point p1 = new Point(xd1, yd1); Point p2 = new Point(xd2, yd2); Point p3 = new Point(xd3, yd3); Point p4 = new Point(xd4, yd4); Point [] pt = new Point [5]; pt[0]=p1; pt[1]=p2; pt[2]=p3; pt[3]=p4; pt[4]=p1; Polygon pg = new Polygon(pt); if(pg.inside(pr1)||pg.inside(pr2)||pg.inside(pr3)||pg.inside(pr4)) { System.out.println("YES"); return; } LineSegment ld1 = new LineSegment(p1, p2); LineSegment ld2 = new LineSegment(p2, p3); LineSegment ld3 = new LineSegment(p3, p4); LineSegment ld4 = new LineSegment(p4, p1); Rectangle rec = new Rectangle(new Point(Math.min(Math.min(xr3,xr4),Math.min(xr1,xr2)), Math.min(Math.min(yr3,yr4),Math.min(yr1,yr2))), new Point(Math.max(Math.max(xr3,xr4),Math.max(xr1,xr2)), Math.max(Math.max(yr3,yr4),Math.max(yr1,yr2))) ); if(rec.contains(p1)||rec.contains(p2)||rec.contains(p3)||rec.contains(p4)) { System.out.println("YES"); return; } if(ld1.intersect(lr1)||ld1.intersect(lr3)||ld1.intersect(lr3)||ld1.intersect(lr4)) { System.out.println("YES"); return; } if(ld2.intersect(lr1)||ld2.intersect(lr3)||ld2.intersect(lr3)||ld2.intersect(lr4)) { System.out.println("YES"); return; } if(ld3.intersect(lr1)||ld3.intersect(lr3)||ld3.intersect(lr3)||ld3.intersect(lr4)) { System.out.println("YES"); return; } if(ld4.intersect(lr1)||ld4.intersect(lr3)||ld4.intersect(lr3)||ld4.intersect(lr4)) { System.out.println("YES"); return; } System.out.println("NO"); } public static class Polygon { // Cases to handle: collinear points, polygons with n < 3 static final double EPS = 1e-9; Point[] g; //first point = last point, counter-clockwise representation Polygon(Point[] o) { g = o; } double perimeter() { double sum = 0.0; for(int i = 0; i < g.length - 1; ++i) sum += g[i].dist(g[i+1]); return sum; } double area() //clockwise/anti-clockwise check, for convex/concave polygons { double area = 0.0; for(int i = 0; i < g.length - 1; ++i) area += g[i].x * g[i+1].y - g[i].y * g[i+1].x; return Math.abs(area) / 2.0; //negative value in case of clockwise } boolean inside(Point p) //for convex/concave polygons - winding number algorithm { double sum = 0.0; for(int i = 0; i < g.length - 1; ++i) { double angle = Point.angle(g[i], p, g[i+1]); if((Math.abs(angle) < EPS || Math.abs(angle - Math.PI) < EPS) && p.between(g[i], g[i+1])) return true; if(Point.ccw(p, g[i], g[i+1])) sum += angle; else sum -= angle; } return Math.abs(2 * Math.PI - Math.abs(sum)) < EPS; //abs makes it work for clockwise } /* * Another way if the polygon is convex * 1. Triangulate the poylgon through p * 2. Check if sum areas == poygon area * 3. Handle empty polygon */ Point centroid() //center of mass { double cx = 0.0, cy = 0.0; for(int i = 0; i < g.length - 1; i++) { double x1 = g[i].x, y1 = g[i].y; double x2 = g[i+1].x, y2 = g[i+1].y; double f = x1 * y2 - x2 * y1; cx += (x1 + x2) * f; cy += (y1 + y2) * f; } double area = area(); //remove abs cx /= 6.0 * area; cy /= 6.0 * area; return new Point(cx, cy); } } static class LineSegment { Point p, q; LineSegment(Point a, Point b) { p = a; q = b; } boolean intersect(LineSegment ls) { Line l1 = new Line(p, q), l2 = new Line(ls.p, ls.q); if(l1.parallel(l2)) { if(l1.same(l2)) return p.between(ls.p, ls.q) || q.between(ls.p, ls.q) || ls.p.between(p, q) || ls.q.between(p, q); return false; } Point c = l1.intersect(l2); return c.between(p, q) && c.between(ls.p, ls.q); } } static class Rectangle { static final double EPS = 1e-9; Point ll, ur; Rectangle(Point a, Point b) { ll = a; ur = b; } double area() { return (ur.x - ll.x) * (ur.y - ll.y); } boolean contains(Point p) { return p.x <= ur.x + EPS && p.x + EPS >= ll.x && p.y <= ur.y + EPS && p.y + EPS >= ll.y; } Rectangle intersect(Rectangle r) { Point ll = new Point(Math.max(this.ll.x, r.ll.x), Math.max(this.ll.y, r.ll.y)); Point ur = new Point(Math.min(this.ur.x, r.ur.x), Math.min(this.ur.y, r.ur.y)); if(Math.abs(ur.x - ll.x) > EPS && Math.abs(ur.y - ll.y) > EPS && this.contains(ll) && this.contains(ur) && r.contains(ll) && r.contains(ur)) return new Rectangle(ll, ur); return null; } } static class Line { static final double INF = 1e9, EPS = 1e-9; double a, b, c; Line(Point p, Point q) { if(Math.abs(p.x - q.x) < EPS) { a = 1; b = 0; c = -p.x; } else { a = (p.y - q.y) / (q.x - p.x); b = 1.0; c = -(a * p.x + p.y); } } Line(Point p, double m) { a = -m; b = 1; c = -(a * p.x + p.y); } boolean parallel(Line l) { return Math.abs(a - l.a) < EPS && Math.abs(b - l.b) < EPS; } boolean same(Line l) { return parallel(l) && Math.abs(c - l.c) < EPS; } Point intersect(Line l) { if(parallel(l)) return null; double x = (b * l.c - c * l.b) / (a * l.b - b * l.a); double y; if(Math.abs(b) < EPS) y = -l.a * x - l.c; else y = -a * x - c; return new Point(x, y); } Point closestPoint(Point p) { if(Math.abs(b) < EPS) return new Point(-c, p.y); if(Math.abs(a) < EPS) return new Point(p.x, -c); return intersect(new Line(p, 1 / a)); } } public static class Vector { double x, y; Vector(double a, double b) { x = a; y = b; } Vector(Point a, Point b) { this(b.x - a.x, b.y - a.y); } Vector scale(double s) { return new Vector(x * s, y * s); } //s is a non-negative value double dot(Vector v) { return (x * v.x + y * v.y); } double cross(Vector v) { return x * v.y - y * v.x; } double norm2() { return x * x + y * y; } Vector reverse() { return new Vector(-x, -y); } Vector normalize() { double d = Math.sqrt(norm2()); return scale(1 / d); } } static class Point implements Comparable<Point>{ static final double EPS = 1e-9; double x, y; Point(double a, double b) { x = a; y = b; } public int compareTo(Point p) { if(Math.abs(x - p.x) > EPS) return x > p.x ? 1 : -1; if(Math.abs(y - p.y) > EPS) return y > p.y ? 1 : -1; return 0; } static double angle(Point a, Point o, Point b) // angle AOB { Vector oa = new Vector(o, a), ob = new Vector(o, b); return Math.acos(oa.dot(ob) / Math.sqrt(oa.norm2() * ob.norm2())); } static boolean ccw(Point p, Point q, Point r) { return new Vector(p, q).cross(new Vector(p, r)) > 0; } public double dist(Point p) { return Math.sqrt(sq(x - p.x) + sq(y - p.y)); } static double sq(double x) { return x * x; } Point rotate(double angle) { double c = Math.cos(angle), s = Math.sin(angle); return new Point(x * c - y * s, x * s + y * c); } // for integer points and rotation by 90 (counterclockwise) : swap x and y, negate x boolean between(Point p, Point q) { return x < Math.max(p.x, q.x) + EPS && x + EPS > Math.min(p.x, q.x) && y < Math.max(p.y, q.y) + EPS && y + EPS > Math.min(p.y, q.y); } //returns true if it is on the line defined by a and b //returns true if it is on the ray whose start point is a and passes through b // Another way: find closest point and calculate the distance between it and p } static class Scanner { StringTokenizer st; BufferedReader br; public Scanner(InputStream s) { br = new BufferedReader(new InputStreamReader(s)); } public String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } public Scanner(String file) throws FileNotFoundException { br = new BufferedReader(new FileReader(file)); } public int nextInt() throws IOException { return Integer.parseInt(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public String nextLine() throws IOException { return br.readLine(); } public long nextlong() throws IOException { String x = next(); StringBuilder sb = new StringBuilder("0"); long res = 0, f = 1; boolean dec = false, neg = false; int start = 0; if (x.charAt(0) == '-') { neg = true; start++; } for (int i = start; i < x.length(); i++) if (x.charAt(i) == '.') { res = Long.parseLong(sb.toString()); sb = new StringBuilder("0"); dec = true; } else { sb.append(x.charAt(i)); if (dec) f *= 10; } res += Long.parseLong(sb.toString()) / f; return res * (neg ? -1 : 1); } public boolean ready() throws IOException { return br.ready(); } } }
constant
994_C. Two Squares
CODEFORCES
import java.util.Arrays; import java.util.Scanner; public class Solution { private static int[] a; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(), m = sc.nextInt(); a = new int[101]; for (int i = 0; i < m; i++) { int type = sc.nextInt(); a[type] = a[type] + 1; } int lo=1, hi=100, max=0; while (lo <= hi) { int mid = lo + (hi - lo)/2; if (check(n, mid)) { max = mid; lo = mid+1; } else { hi = mid -1; } } System.out.println(max); } public static boolean check(int n, int target) { int result = 0; for (int i=0; i <a.length; i++) { result = result + (a[i] / target); } if (result >= n) {return true;} return false; } }
nlogn
1011_B. Planning The Expedition
CODEFORCES
import java.util.List; import java.util.Scanner; import java.util.Comparator; import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Collections; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author @zhendeaini6001 */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; Scanner in = new Scanner(inputStream); PrintWriter out = new PrintWriter(outputStream); TaskA solver = new TaskA(); solver.solve(1, in, out); out.close(); } } class TaskA { class Pair{ public int a; public int b; public Pair(int a, int b) { // TODO Auto-generated constructor stub this.a = a; this.b = b; } } public void solve(int testNumber, Scanner in, PrintWriter out) { int n = in.nextInt(); int k = in.nextInt(); --k; ArrayList<Pair> list = new ArrayList<Pair>(); for (int i = 1; i <= n; ++i){ int num = in.nextInt(); int pen = in.nextInt(); Pair t = new Pair(num, pen); list.add(t); } Collections.sort(list, new Comparator<Pair>(){ public int compare(Pair o1, Pair o2){ if (o1.a != o2.a){ return (o2.a - o1.a); } return (o1.b - o2.b); } }); int res = 1; Pair compare = list.get(k); int i = k - 1; while (i >= 0){ Pair t = list.get(i); if (t.a == compare.a && t.b == compare.b){ --i; ++res; continue; }else{ break; } } i = k + 1; while (i < list.size()){ Pair t = list.get(i); if (t.a == compare.a && t.b == compare.b){ ++res; ++i; continue; }else{ break; } } out.println(res); return; } }
nlogn
166_A. Rank List
CODEFORCES
import java.util.Scanner; public class LuckyDivision { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); if( n % 4==0 || n % 7==0 || n % 47==0 || n % 74==0 || n % 447==0 || n % 474==0 || n % 477==0 || n % 744==0 || n % 774==0 || n % 777==0 ) System.out.println("YES"); else System.out.println("NO"); } }
constant
122_A. Lucky Division
CODEFORCES