Submission #5804809


Source Code Expand

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 dyominov
 */
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);
        AWheresSnuke solver = new AWheresSnuke();
        solver.solve(1, in, out);
        out.close();
    }

    static class AWheresSnuke {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int h = in.nextInt();
            int w = in.nextInt();
            for (int i = 1; i <= h; i++) {
                for (int j = 0; j < w; j++) {
                    String s = in.next();
                    if (s.equals("snuke")) {
                        out.println((char) (j + 'A') + "" + i);
                        return;
                    }
                }
            }

        }

    }

    static class InputReader implements AutoCloseable {
        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 void close() {
        }

    }
}

Submission Info

Submission Time
Task A - Where's Snuke?
User dyominov
Language Java8 (OpenJDK 1.8.0)
Score 100
Code Size 2159 Byte
Status AC
Exec Time 83 ms
Memory 23508 KB

Judge Result

Set Name sample all
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 11
Set Name Test Cases
sample sample-01.txt, sample-02.txt
all sample-01.txt, sample-02.txt, 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, 01-07.txt, sample-01.txt, sample-02.txt
Case Name Status Exec Time Memory
01-01.txt AC 73 ms 20816 KB
01-02.txt AC 71 ms 19028 KB
01-03.txt AC 73 ms 19412 KB
01-04.txt AC 73 ms 19028 KB
01-05.txt AC 83 ms 19796 KB
01-06.txt AC 74 ms 19156 KB
01-07.txt AC 72 ms 23380 KB
sample-01.txt AC 77 ms 18260 KB
sample-02.txt AC 71 ms 23508 KB