結果
| 問題 | No.280 歯車の問題(1) |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2022-07-29 17:34:48 |
| 言語 | Java (openjdk 26.0.2.1) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 1,000 ms |
| + 401µs | |
| コード長 | 1,167 bytes |
| 記録 | |
| コンパイル時間 | 1,502 ms |
| コンパイル使用メモリ | 85,996 KB |
| 実行使用メモリ | 40,888 KB |
| 最終ジャッジ日時 | 2026-08-18 08:09:25 |
| 合計ジャッジ時間 | 5,355 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner();
int n = sc.nextInt();
int a = 0;
int b = 0;
for (int i = 0; i < n; i++) {
int x = sc.nextInt();
if (i == 0) {
b = x;
} else if (i == n - 1) {
a = x;
}
}
System.out.println(a + "/" + b);
}
}
class Scanner {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new StringTokenizer("");
public Scanner() throws Exception {
}
public int nextInt() throws Exception {
return Integer.parseInt(next());
}
public long nextLong() throws Exception {
return Long.parseLong(next());
}
public double nextDouble() throws Exception {
return Double.parseDouble(next());
}
public String next() throws Exception {
while (!st.hasMoreTokens()) {
st = new StringTokenizer(br.readLine());
}
return st.nextToken();
}
}
tenten