Submission #432394
Source Code Expand
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class Main { static InputStream is; static PrintWriter out; static String INPUT = ""; final int INF = Integer.MAX_VALUE; final int MIN = Integer.MIN_VALUE; static void solve() { String a = ns(); int n = ni() - 1; System.out.println(a.charAt(n / 5) + "" + a.charAt(n % 5)); } public static void main(String[] args) throws Exception { long S = System.currentTimeMillis(); is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes()); out = new PrintWriter(System.out); solve(); out.flush(); long G = System.currentTimeMillis(); tr(G - S + "ms"); } private static boolean eof() { if (lenbuf == -1) return true; int lptr = ptrbuf; while (lptr < lenbuf) if (!isSpaceChar(inbuf[lptr++])) return false; try { is.mark(1000); while (true) { int b = is.read(); if (b == -1) { is.reset(); return true; } else if (!isSpaceChar(b)) { is.reset(); return false; } } } catch (IOException e) { return true; } } private static byte[] inbuf = new byte[1024]; static int lenbuf = 0, ptrbuf = 0; private static int readByte() { if (lenbuf == -1) throw new InputMismatchException(); if (ptrbuf >= lenbuf) { ptrbuf = 0; try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); } if (lenbuf <= 0) return -1; } return inbuf[ptrbuf++]; } private static boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); } // private static boolean isSpaceChar(int c) { return !(c >= 32 && c <= 126); } private static int skip() { int b; while ((b = readByte()) != -1 && isSpaceChar(b)) ; return b; } private static double nd() { return Double.parseDouble(ns()); } private static char nc() { return (char) skip(); } private static String ns() { int b = skip(); StringBuilder sb = new StringBuilder(); while (!(isSpaceChar(b))) { sb.appendCodePoint(b); b = readByte(); } return sb.toString(); } private static char[] ns(int n) { char[] buf = new char[n]; int b = skip(), p = 0; while (p < n && !(isSpaceChar(b))) { buf[p++] = (char) b; b = readByte(); } return n == p ? buf : Arrays.copyOf(buf, p); } private static char[][] nm(int n, int m) { char[][] map = new char[n][]; for (int i = 0; i < n; i++) map[i] = ns(m); return map; } private static int[] na(int n) { int[] a = new int[n]; for (int i = 0; i < n; i++) a[i] = ni(); return a; } private static int ni() { int num = 0, b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } private static long nl() { long num = 0; int b; boolean minus = false; while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ; if (b == '-') { minus = true; b = readByte(); } while (true) { if (b >= '0' && b <= '9') { num = num * 10 + (b - '0'); } else { return minus ? -num : num; } b = readByte(); } } private static void tr(Object... o) { if (INPUT.length() != 0) System.out.println(Arrays.deepToString(o)); } }
Submission Info
Submission Time | |
---|---|
Task | A - 25個の文字列 |
User | elzup |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 4544 Byte |
Status | AC |
Exec Time | 338 ms |
Memory | 22868 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | 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, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample-01.txt | AC | 314 ms | 22808 KB |
sample-02.txt | AC | 318 ms | 22800 KB |
sample-03.txt | AC | 307 ms | 22716 KB |
test-01.txt | AC | 315 ms | 22800 KB |
test-02.txt | AC | 314 ms | 22760 KB |
test-03.txt | AC | 316 ms | 22800 KB |
test-04.txt | AC | 313 ms | 22772 KB |
test-05.txt | AC | 315 ms | 22704 KB |
test-06.txt | AC | 308 ms | 22760 KB |
test-07.txt | AC | 316 ms | 22728 KB |
test-08.txt | AC | 317 ms | 22792 KB |
test-09.txt | AC | 314 ms | 22800 KB |
test-10.txt | AC | 313 ms | 22788 KB |
test-11.txt | AC | 314 ms | 22792 KB |
test-12.txt | AC | 325 ms | 22788 KB |
test-13.txt | AC | 330 ms | 22764 KB |
test-14.txt | AC | 324 ms | 22780 KB |
test-15.txt | AC | 317 ms | 22816 KB |
test-16.txt | AC | 324 ms | 22792 KB |
test-17.txt | AC | 310 ms | 22668 KB |
test-18.txt | AC | 306 ms | 22792 KB |
test-19.txt | AC | 306 ms | 22732 KB |
test-20.txt | AC | 306 ms | 22800 KB |
test-21.txt | AC | 311 ms | 22716 KB |
test-22.txt | AC | 317 ms | 22772 KB |
test-23.txt | AC | 320 ms | 22680 KB |
test-24.txt | AC | 305 ms | 22788 KB |
test-25.txt | AC | 309 ms | 22792 KB |
test-26.txt | AC | 311 ms | 22792 KB |
test-27.txt | AC | 311 ms | 22788 KB |
test-28.txt | AC | 310 ms | 22868 KB |
test-29.txt | AC | 322 ms | 22792 KB |
test-30.txt | AC | 338 ms | 22776 KB |