ログインしてください。
提出 #75610617
ソースコード 拡げる
import java.io.*;
import java.util.*;
public class Main {
static FastReader scanner = new FastReader();
static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
public static void main(String[] args) throws IOException {
// int tt = nint();
int tt = 1;
for (int i = 1; i <= tt; i++) {
solve();
}
out.close();
}
private static void solve() {
int n = nint();
int[] a = readIntArr(n);
int x = nint();
out.print(a[x - 1]);
}
static class FastReader {
BufferedReader br;
StringTokenizer st;
public FastReader() {
br = new BufferedReader(
new InputStreamReader(System.in));
}
String next() {
while (st == null || !st.hasMoreElements()) {
try {
st = new StringTokenizer(br.readLine());
} catch (IOException e) {
e.printStackTrace();
}
}
return st.nextToken();
}
int nextInt() {
return Integer.parseInt(next());
}
long nextLong() {
return Long.parseLong(next());
}
double nextDouble() {
return Double.parseDouble(next());
}
String nextLine() {
String str = "";
try {
str = br.readLine();
} catch (IOException e) {
e.printStackTrace();
}
return str;
}
}
public static int nint() { return scanner.nextInt(); }
public static long nlong() { return scanner.nextLong(); }
public static double ndouble() { return scanner.nextDouble(); }
public static String nline() { return scanner.nextLine(); }
public static int[] readIntArr(int n) {
int[] arr = new int[n];
for (int i = 0; i < n; i++) {
arr[i] = nint();
}
return arr;
}
public static long[] readLongArr(int n) {
long[] arr = new long[n];
for (int i = 0; i < n; i++) {
arr[i] = nlong();
}
return arr;
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - Array |
| ユーザ | tohoshinki254 |
| 言語 | Java24 (OpenJDK 24.0.2) |
| 得点 | 100 |
| コード長 | 2284 Byte |
| 結果 | AC |
| 実行時間 | 49 ms |
| メモリ | 38112 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_00.txt | AC | 49 ms | 38000 KiB |
| 00_sample_01.txt | AC | 43 ms | 38052 KiB |
| 00_sample_02.txt | AC | 44 ms | 37968 KiB |
| 01_random_00.txt | AC | 44 ms | 37780 KiB |
| 01_random_01.txt | AC | 43 ms | 37840 KiB |
| 01_random_02.txt | AC | 45 ms | 38112 KiB |
| 01_random_03.txt | AC | 45 ms | 37964 KiB |
| 01_random_04.txt | AC | 45 ms | 37964 KiB |
| 01_random_05.txt | AC | 43 ms | 38024 KiB |
| 01_random_06.txt | AC | 45 ms | 38012 KiB |