結果

問題 No.587 七対子
ユーザー ThhG_9l3ThhG_9l3
提出日時 2018-05-05 18:08:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 635 bytes
コンパイル時間 1,947 ms
コンパイル使用メモリ 72,388 KB
実行使用メモリ 56,248 KB
最終ジャッジ日時 2023-09-10 10:35:46
合計ジャッジ時間 7,432 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,740 KB
testcase_01 AC 117 ms
55,616 KB
testcase_02 AC 116 ms
55,584 KB
testcase_03 AC 116 ms
55,624 KB
testcase_04 AC 117 ms
55,840 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 117 ms
55,732 KB
testcase_11 WA -
testcase_12 AC 116 ms
55,524 KB
testcase_13 AC 116 ms
56,112 KB
testcase_14 AC 116 ms
55,916 KB
testcase_15 AC 118 ms
55,692 KB
testcase_16 AC 117 ms
55,352 KB
testcase_17 AC 118 ms
55,900 KB
testcase_18 WA -
testcase_19 AC 117 ms
55,520 KB
testcase_20 AC 118 ms
55,636 KB
testcase_21 AC 116 ms
55,904 KB
testcase_22 AC 116 ms
55,676 KB
testcase_23 AC 117 ms
55,684 KB
testcase_24 AC 116 ms
55,992 KB
testcase_25 AC 120 ms
55,616 KB
testcase_26 AC 116 ms
55,700 KB
testcase_27 AC 115 ms
55,716 KB
testcase_28 WA -
testcase_29 AC 115 ms
55,696 KB
testcase_30 AC 115 ms
55,372 KB
testcase_31 AC 116 ms
55,584 KB
testcase_32 AC 117 ms
55,528 KB
testcase_33 WA -
testcase_34 AC 116 ms
55,568 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[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