結果

問題 No.313 π
ユーザー tenten
提出日時 2020-12-23 16:26:02
言語 Java
(openjdk 23)
結果
AC  
実行時間 265 ms / 5,000 ms
コード長 699 bytes
コンパイル時間 2,439 ms
コンパイル使用メモリ 76,352 KB
実行使用メモリ 58,644 KB
最終ジャッジ日時 2024-09-21 16:26:20
合計ジャッジ時間 12,393 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    static int[] counts = new int[]{20104, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841};
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        for (char c : sc.next().toCharArray()) {
            if (c == '.') {
                continue;
            }
            counts[c - '0']--;
        }
        int left = 0;
        int right = 0;
        for (int i = 0; i < counts.length; i++) {
            if (counts[i] == -1) {
                left = i;
            } else if (counts[i] == 1) {
                right = i;
            }
        }
        System.out.println(left + " " + right);
    }
}
0