結果

問題 No.587 七対子
ユーザー ThhG_9l3
提出日時 2018-05-05 18:08:52
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 2,012 ms
コンパイル使用メモリ 74,240 KB
実行使用メモリ 41,568 KB
最終ジャッジ日時 2024-06-28 01:59:33
合計ジャッジ時間 7,371 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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[m] != '/') {
					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");
		}
	}
}
0