Submission #170090

#TimeUsernameProblemLanguageResultExecution timeMemory
170090ijxjdjdRemittance (JOI19_remittance)Java
Compilation error
0 ms0 KiB
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 ijxjdjd */ public class remittance { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); remittanc solver = new remittanc(); solver.solve(1, in, out); out.close(); } static class remittance { public void solve(int testNumber, InputReader in, PrintWriter out) { int N = in.nextInt(); long[] val = new long[N]; long last = 0; long max = 0; for (int i = 0; i < N; i++) { val[i] = in.nextInt() - in.nextInt(); max = Math.max(val[i], max); } boolean first = true; // while (last > 0 || first) { for (int j = 0; j < 1000; j++) { for (int i = 0; i < N; i++) { val[i] += last; if (val[i] > 0) { last = (val[i] + 1) / 2; val[i] -= last * 2; } else { last = 0; } } // } } val[0] += last; for (int i = 0; i < N; i++) { if (val[i] != 0) { out.println("No"); return; } } out.println("Yes"); } } 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()); } } }

Compilation message (stderr)

remittance.java:28: error: class remittance is already defined in package unnamed package
    static class remittance {
           ^
remittance.java:23: error: cannot find symbol
        remittanc solver = new remittanc();
        ^
  symbol:   class remittanc
  location: class remittance
remittance.java:23: error: cannot find symbol
        remittanc solver = new remittanc();
                               ^
  symbol:   class remittanc
  location: class remittance
3 errors