結果

問題 No.548 国士無双
ユーザー fal_rndfal_rnd
提出日時 2017-08-25 23:20:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 137 ms / 2,000 ms
コード長 789 bytes
コンパイル時間 9,186 ms
コンパイル使用メモリ 82,572 KB
実行使用メモリ 57,716 KB
最終ジャッジ日時 2023-10-17 16:20:12
合計ジャッジ時間 13,552 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
57,564 KB
testcase_01 AC 131 ms
57,548 KB
testcase_02 AC 131 ms
57,588 KB
testcase_03 AC 136 ms
57,248 KB
testcase_04 AC 132 ms
57,592 KB
testcase_05 AC 127 ms
57,604 KB
testcase_06 AC 128 ms
57,428 KB
testcase_07 AC 136 ms
57,528 KB
testcase_08 AC 127 ms
57,448 KB
testcase_09 AC 124 ms
57,196 KB
testcase_10 AC 126 ms
57,716 KB
testcase_11 AC 126 ms
57,692 KB
testcase_12 AC 126 ms
57,200 KB
testcase_13 AC 134 ms
57,468 KB
testcase_14 AC 122 ms
55,760 KB
testcase_15 AC 137 ms
57,620 KB
testcase_16 AC 133 ms
57,524 KB
testcase_17 AC 126 ms
57,204 KB
testcase_18 AC 125 ms
57,192 KB
testcase_19 AC 128 ms
57,528 KB
testcase_20 AC 125 ms
57,380 KB
testcase_21 AC 128 ms
57,456 KB
testcase_22 AC 126 ms
57,496 KB
testcase_23 AC 128 ms
57,616 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main{
	static IntStream REPS(int v){return IntStream.range(0,v);}
	static IntStream REPS(int l,int r){return IntStream.rangeClosed(l,r);}
	static IntStream INS(int n) {return REPS(n).map(i->getInt());}
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}

	public static void main(String[]$){
		HashSet<Integer>r=new HashSet<>();
		"abcdefghijklm".chars().forEach(r::add);
		s.next().chars().forEach(r::remove);

		if(r.size()==1)
			System.out.println((char)(int)r.stream().findAny().get());
		else if(r.isEmpty())
			"abcdefghijklm".chars().mapToObj(i->(char)i).forEach(System.out::println);
		else
			System.out.println("Impossible");
	}
}
0