結果

問題 No.548 国士無双
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2017-07-28 22:32:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 119 ms / 2,000 ms
コード長 704 bytes
コンパイル時間 2,050 ms
コンパイル使用メモリ 74,792 KB
実行使用メモリ 57,544 KB
最終ジャッジ日時 2023-10-17 15:17:00
合計ジャッジ時間 6,109 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
57,444 KB
testcase_01 AC 115 ms
57,200 KB
testcase_02 AC 115 ms
57,332 KB
testcase_03 AC 104 ms
55,904 KB
testcase_04 AC 113 ms
57,420 KB
testcase_05 AC 116 ms
57,296 KB
testcase_06 AC 116 ms
57,252 KB
testcase_07 AC 116 ms
57,348 KB
testcase_08 AC 117 ms
57,484 KB
testcase_09 AC 114 ms
57,420 KB
testcase_10 AC 114 ms
57,208 KB
testcase_11 AC 115 ms
57,160 KB
testcase_12 AC 115 ms
57,136 KB
testcase_13 AC 118 ms
57,332 KB
testcase_14 AC 116 ms
57,424 KB
testcase_15 AC 114 ms
57,216 KB
testcase_16 AC 114 ms
57,248 KB
testcase_17 AC 116 ms
57,312 KB
testcase_18 AC 118 ms
57,420 KB
testcase_19 AC 118 ms
57,544 KB
testcase_20 AC 106 ms
56,084 KB
testcase_21 AC 116 ms
57,484 KB
testcase_22 AC 119 ms
57,412 KB
testcase_23 AC 118 ms
57,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.next();
        int [] alp = new int [26];
        for(int i=0; i<13; i++){
            alp[(S.charAt(i)-'a')]++;
        }
        int z=0;
        for(int i=0; i<13; i++){
            if(alp[i]==0)z++;
        }
        if(z>=2){
            System.out.println("Impossible");
        }else if(z==1){
            for(int i=0; i<13; i++){
                if(alp[i]==0)System.out.println((char)(i+'a'));
            }
        }else{
            for(int i=0; i<13; i++){
                System.out.println((char)(i+'a'));
            }
        }
    }
}
0