Submission #296307
Source Code Expand
import java.io.*; import java.util.*; public class Main { FastScanner in = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); public void run() { int m = in.nextInt(); int x = 0; if (m < 100) x = 0; else if (m <= 5000) { x = m / 100; } else if (m <= 30000) { x = m / 1000 + 50; } else if (m <= 70000) { x = ((m / 1000) - 30) / 5 + 80; } else { x = 89; } System.out.println(((x < 10) ? "0" : "") + x); out.close(); } public static void main(String[] args) { new Main().run(); } public void mapDebug(int[][] a) { System.out.println("--------map display---------"); for (int i = 0; i < a.length; i++) { for (int j = 0; j < a[i].length; j++) { System.out.printf("%3d ", a[i][j]); } System.out.println(); } System.out.println("----------------------------"); System.out.println(); } public void debug(Object... obj) { System.out.println(Arrays.deepToString(obj)); } class FastScanner { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private int numChars; public FastScanner(InputStream stream) { this.stream = stream; //stream = new FileInputStream(new File("dec.in")); } 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()); } int[] nextIntArray(int n) { int[] array = new int[n]; for (int i = 0; i < n; i++) array[i] = nextInt(); return array; } int[][] nextIntMap(int n, int m) { int[][] map = new int[n][m]; for (int i = 0; i < n; i++) { map[i] = in.nextIntArray(m); } return map; } long nextLong() { return Long.parseLong(next()); } long[] nextLongArray(int n) { long[] array = new long[n]; for (int i = 0; i < n; i++) array[i] = nextLong(); return array; } long[][] nextLongMap(int n, int m) { long[][] map = new long[n][m]; for (int i = 0; i < n; i++) { map[i] = in.nextLongArray(m); } return map; } double nextDouble() { return Double.parseDouble(next()); } double[] nextDoubleArray(int n) { double[] array = new double[n]; for (int i = 0; i < n; i++) array[i] = nextDouble(); return array; } double[][] nextDoubleMap(int n, int m) { double[][] map = new double[n][m]; for (int i = 0; i < n; i++) { map[i] = in.nextDoubleArray(m); } return map; } 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[] nextStringArray(int n) { String[] array = new String[n]; for (int i = 0; i < n; i++) array[i] = next(); return array; } 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(); } } }
Submission Info
Submission Time | |
---|---|
Task | B - 視程の通報 |
User | hiro116s |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 3672 Byte |
Status | AC |
Exec Time | 374 ms |
Memory | 17712 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, test_01.txt, test_02.txt, test_03.txt, test_04.txt, test_05.txt, test_06.txt, test_07.txt, test_08.txt, test_09.txt, test_10.txt, test_11.txt, test_12.txt, test_13.txt, test_14.txt, test_15.txt, test_16.txt, test_17.txt, test_18.txt, test_19.txt, test_20.txt, test_21.txt, test_22.txt, test_23.txt, test_24.txt, test_25.txt, test_26.txt, test_27.txt, test_28.txt, test_29.txt, test_30.txt, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 355 ms | 17552 KB |
00_sample_02.txt | AC | 351 ms | 17584 KB |
00_sample_03.txt | AC | 350 ms | 17580 KB |
test_01.txt | AC | 364 ms | 17520 KB |
test_02.txt | AC | 348 ms | 17588 KB |
test_03.txt | AC | 354 ms | 17568 KB |
test_04.txt | AC | 374 ms | 17688 KB |
test_05.txt | AC | 355 ms | 17640 KB |
test_06.txt | AC | 352 ms | 17592 KB |
test_07.txt | AC | 353 ms | 17604 KB |
test_08.txt | AC | 355 ms | 17580 KB |
test_09.txt | AC | 350 ms | 17600 KB |
test_10.txt | AC | 355 ms | 17632 KB |
test_11.txt | AC | 364 ms | 17652 KB |
test_12.txt | AC | 368 ms | 17556 KB |
test_13.txt | AC | 355 ms | 17536 KB |
test_14.txt | AC | 354 ms | 17604 KB |
test_15.txt | AC | 357 ms | 17588 KB |
test_16.txt | AC | 372 ms | 17532 KB |
test_17.txt | AC | 352 ms | 17564 KB |
test_18.txt | AC | 353 ms | 17560 KB |
test_19.txt | AC | 354 ms | 17668 KB |
test_20.txt | AC | 354 ms | 17592 KB |
test_21.txt | AC | 352 ms | 17596 KB |
test_22.txt | AC | 353 ms | 17600 KB |
test_23.txt | AC | 356 ms | 17592 KB |
test_24.txt | AC | 354 ms | 17564 KB |
test_25.txt | AC | 351 ms | 17628 KB |
test_26.txt | AC | 354 ms | 17684 KB |
test_27.txt | AC | 359 ms | 17620 KB |
test_28.txt | AC | 359 ms | 17592 KB |
test_29.txt | AC | 355 ms | 17552 KB |
test_30.txt | AC | 355 ms | 17704 KB |
test_31.txt | AC | 355 ms | 17616 KB |
test_32.txt | AC | 357 ms | 17680 KB |
test_33.txt | AC | 363 ms | 17576 KB |
test_34.txt | AC | 352 ms | 17612 KB |
test_35.txt | AC | 355 ms | 17712 KB |