Submission #432332


Source Code Expand

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashSet;
import java.util.List;

class Solve{
	ContestScanner in;
	Solve() throws FileNotFoundException{
		in = new ContestScanner();
	}
	
	void solve() throws IOException{
		char[] s = in.nextToken().toCharArray();
		int n = in.nextInt();
		List<String> list = new ArrayList<String>();
		for(int i=0; i<5; i++){
			for(int j=0; j<5; j++){
				list.add(s[i]+""+s[j]+"");
			}
		}
		System.out.println(list.get(n-1));
	}
	
	
}

public class Main {
	static HashSet<String> set = new HashSet<String>();
	public static void main(String[] args) throws NumberFormatException,
	IOException {
		Solve solve = new Solve();
		solve.solve();
	}
}

class Timer{
	long time;
	public void set(){
		time = System.currentTimeMillis();
	}
	
	public long stop(){
		return System.currentTimeMillis()-time;
	}
}

class Node{
	int id;
	ArrayList<Node> edge = new ArrayList<Node>();
	public Node(int id) {
		this.id = id;
	}
	public void createEdge(Node node) {
		edge.add(node);
	}
}

class MyComp implements Comparator<int[]> {
	final int idx;
	public MyComp(int idx){
		this.idx = idx;
	}
	public int compare(int[] a, int[] b) {
		return a[idx] - b[idx];
	}
}

class Reverse implements Comparator<Integer> {
	public int compare(Integer arg0, Integer arg1) {
		return arg1 - arg0;
	}
}


class ContestWriter {
	private PrintWriter out;

	public ContestWriter(String filename) throws IOException {
		out = new PrintWriter(new BufferedWriter(new FileWriter(filename)));
	}

	public ContestWriter() throws IOException {
		out = new PrintWriter(System.out);
	}

	public void println(String str) {
		out.println(str);
	}
	
	public void println(Object obj) {
		out.println(obj);
	}

	public void print(String str) {
		out.print(str);
	}
	
	public void print(Object obj) {
		out.print(obj);
	}

	public void close() {
		out.close();
	}
}

class ContestScanner {
	private BufferedReader reader;
	private String[] line;
	private int idx;

	public ContestScanner() throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(System.in));
	}

	public ContestScanner(String filename) throws FileNotFoundException {
		reader = new BufferedReader(new InputStreamReader(new FileInputStream(
				filename)));
	}

	public String nextToken() throws IOException {
		if (line == null || line.length <= idx) {
			line = reader.readLine().trim().split(" ");
			idx = 0;
		}
		return line[idx++];
	}
	
	public String readLine() throws IOException{
		return reader.readLine();
	}

	public long nextLong() throws IOException, NumberFormatException {
		return Long.parseLong(nextToken());
	}

	public int nextInt() throws NumberFormatException, IOException {
		return (int) nextLong();
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}
}

Submission Info

Submission Time
Task A - 25個の文字列
User threepipes_s
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 3259 Byte
Status AC
Exec Time 301 ms
Memory 22556 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 3
AC × 33
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 285 ms 22556 KB
sample-02.txt AC 278 ms 22340 KB
sample-03.txt AC 280 ms 22424 KB
test-01.txt AC 283 ms 22340 KB
test-02.txt AC 281 ms 22332 KB
test-03.txt AC 280 ms 22396 KB
test-04.txt AC 282 ms 22440 KB
test-05.txt AC 292 ms 22408 KB
test-06.txt AC 290 ms 22352 KB
test-07.txt AC 289 ms 22352 KB
test-08.txt AC 287 ms 22396 KB
test-09.txt AC 286 ms 22428 KB
test-10.txt AC 287 ms 22448 KB
test-11.txt AC 287 ms 22432 KB
test-12.txt AC 288 ms 22380 KB
test-13.txt AC 289 ms 22396 KB
test-14.txt AC 287 ms 22392 KB
test-15.txt AC 286 ms 22424 KB
test-16.txt AC 287 ms 22360 KB
test-17.txt AC 287 ms 22428 KB
test-18.txt AC 289 ms 22420 KB
test-19.txt AC 287 ms 22376 KB
test-20.txt AC 289 ms 22348 KB
test-21.txt AC 294 ms 22368 KB
test-22.txt AC 299 ms 22408 KB
test-23.txt AC 288 ms 22344 KB
test-24.txt AC 288 ms 22348 KB
test-25.txt AC 286 ms 22424 KB
test-26.txt AC 294 ms 22432 KB
test-27.txt AC 301 ms 22412 KB
test-28.txt AC 289 ms 22408 KB
test-29.txt AC 295 ms 22420 KB
test-30.txt AC 288 ms 22404 KB