結果
問題 | No.548 国士無双 |
ユーザー |
![]() |
提出日時 | 2017-08-25 23:20:21 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 130 ms / 2,000 ms |
コード長 | 789 bytes |
コンパイル時間 | 2,514 ms |
コンパイル使用メモリ | 83,880 KB |
実行使用メモリ | 54,364 KB |
最終ジャッジ日時 | 2024-09-17 13:45:31 |
合計ジャッジ時間 | 6,106 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
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"); } }