結果
問題 |
No.587 七対子
|
ユーザー |
![]() |
提出日時 | 2018-05-05 18:07:00 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 619 bytes |
コンパイル時間 | 2,061 ms |
コンパイル使用メモリ | 74,396 KB |
実行使用メモリ | 41,480 KB |
最終ジャッジ日時 | 2024-06-28 01:59:26 |
合計ジャッジ時間 | 7,658 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 WA * 9 |
ソースコード
package yukikoda; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] ch = new char[13]; String str = sc.next(); int count = 0; for(int i=0; i<ch.length; i++) { ch[i] = str.charAt(i); } for(int k=0; k<12; k++) { for(int m=k+1; m<13; m++) { if(ch[k] == ch[m] && ch[k] != '/') { ch[k] = '/'; ch[m] = '/'; count++; } } } if(count == 6) { for(int l=0; l<13; l++) { if(ch[l] != '/') { System.out.println(ch[l]); } } }else { System.out.println("Impossible"); } } }