結果
| 問題 | No.587 七対子 |
| コンテスト | |
| ユーザー |
fukusei
|
| 提出日時 | 2018-05-05 17:59:10 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 60 ms / 2,000 ms |
| コード長 | 663 bytes |
| 記録 | |
| コンパイル時間 | 3,608 ms |
| コンパイル使用メモリ | 84,496 KB |
| 実行使用メモリ | 130,008 KB |
| 最終ジャッジ日時 | 2026-04-02 18:10:27 |
| 合計ジャッジ時間 | 5,545 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 35 |
ソースコード
import java.util.*;
public class paiza {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
int count = 0;
String match = "";
char ch;
for (int i = 0; i < str.length(); i++) {
ch = str.charAt(i);
if ( str.indexOf(ch,i+1) != -1) {
if ( match.indexOf(ch) == -1 ){
count++;
match = match + ch;
}
}
}
if (count == 6) {
for(int i=0; i<str.length(); i++) {
if(match.indexOf(str.charAt(i)) == -1){
System.out.println(str.charAt(i));
return;
}
}
System.out.println("Impossible");
}
else {
System.out.println("Impossible");
}
}
}
fukusei