結果

問題 No.587 七対子
ユーザー ThhG_9l3ThhG_9l3
提出日時 2018-05-05 18:07:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 619 bytes
コンパイル時間 2,555 ms
コンパイル使用メモリ 71,960 KB
実行使用メモリ 56,212 KB
最終ジャッジ日時 2023-09-10 10:35:38
合計ジャッジ時間 9,017 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,896 KB
testcase_01 AC 118 ms
55,900 KB
testcase_02 AC 118 ms
56,080 KB
testcase_03 AC 118 ms
55,956 KB
testcase_04 AC 116 ms
55,388 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 117 ms
55,692 KB
testcase_11 WA -
testcase_12 AC 118 ms
55,928 KB
testcase_13 AC 118 ms
55,612 KB
testcase_14 AC 119 ms
55,608 KB
testcase_15 AC 120 ms
55,464 KB
testcase_16 AC 119 ms
55,624 KB
testcase_17 AC 118 ms
55,844 KB
testcase_18 WA -
testcase_19 AC 118 ms
55,648 KB
testcase_20 AC 119 ms
55,860 KB
testcase_21 AC 119 ms
55,568 KB
testcase_22 AC 120 ms
55,780 KB
testcase_23 AC 118 ms
55,668 KB
testcase_24 AC 117 ms
55,392 KB
testcase_25 AC 117 ms
55,752 KB
testcase_26 AC 117 ms
55,896 KB
testcase_27 AC 116 ms
55,776 KB
testcase_28 WA -
testcase_29 AC 117 ms
55,676 KB
testcase_30 AC 117 ms
56,084 KB
testcase_31 AC 116 ms
53,784 KB
testcase_32 AC 117 ms
55,900 KB
testcase_33 WA -
testcase_34 AC 118 ms
56,072 KB
権限があれば一括ダウンロードができます

ソースコード

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[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