結果

問題 No.280 歯車の問題(1)
ユーザー tentententen
提出日時 2022-07-29 17:34:48
言語 Java21
(openjdk 21)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 1,167 bytes
コンパイル時間 4,703 ms
コンパイル使用メモリ 75,736 KB
実行使用メモリ 53,544 KB
最終ジャッジ日時 2023-09-26 14:14:29
合計ジャッジ時間 11,762 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
50,988 KB
testcase_01 AC 81 ms
52,364 KB
testcase_02 AC 86 ms
52,564 KB
testcase_03 AC 92 ms
52,884 KB
testcase_04 AC 76 ms
51,300 KB
testcase_05 AC 84 ms
52,580 KB
testcase_06 AC 82 ms
52,480 KB
testcase_07 AC 82 ms
52,680 KB
testcase_08 AC 77 ms
48,952 KB
testcase_09 AC 82 ms
52,464 KB
testcase_10 AC 82 ms
52,608 KB
testcase_11 AC 79 ms
52,376 KB
testcase_12 AC 81 ms
52,368 KB
testcase_13 AC 85 ms
53,264 KB
testcase_14 AC 84 ms
53,544 KB
testcase_15 AC 80 ms
52,680 KB
testcase_16 AC 80 ms
52,308 KB
testcase_17 AC 82 ms
52,104 KB
testcase_18 AC 92 ms
52,892 KB
testcase_19 AC 92 ms
52,500 KB
testcase_20 AC 83 ms
52,832 KB
testcase_21 AC 77 ms
51,912 KB
testcase_22 AC 82 ms
52,448 KB
testcase_23 AC 85 ms
52,608 KB
testcase_24 AC 83 ms
52,368 KB
testcase_25 AC 82 ms
52,516 KB
testcase_26 AC 89 ms
52,332 KB
testcase_27 AC 77 ms
51,352 KB
testcase_28 AC 76 ms
50,800 KB
testcase_29 AC 81 ms
52,372 KB
testcase_30 AC 75 ms
50,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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();
    }
}
0