結果

問題 No.587 七対子
ユーザー ThhG_9l3ThhG_9l3
提出日時 2018-05-06 00:28:55
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 913 bytes
コンパイル時間 1,987 ms
コンパイル使用メモリ 78,268 KB
実行使用メモリ 56,500 KB
最終ジャッジ日時 2023-09-10 10:39:58
合計ジャッジ時間 7,458 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
55,636 KB
testcase_01 AC 117 ms
55,708 KB
testcase_02 AC 117 ms
55,660 KB
testcase_03 AC 117 ms
55,576 KB
testcase_04 AC 118 ms
55,616 KB
testcase_05 WA -
testcase_06 AC 118 ms
55,752 KB
testcase_07 AC 117 ms
55,328 KB
testcase_08 AC 117 ms
55,712 KB
testcase_09 WA -
testcase_10 AC 117 ms
55,472 KB
testcase_11 AC 117 ms
55,500 KB
testcase_12 AC 119 ms
55,980 KB
testcase_13 AC 118 ms
55,840 KB
testcase_14 AC 117 ms
55,620 KB
testcase_15 AC 118 ms
55,680 KB
testcase_16 AC 116 ms
55,708 KB
testcase_17 AC 116 ms
56,128 KB
testcase_18 AC 118 ms
55,324 KB
testcase_19 AC 116 ms
55,440 KB
testcase_20 AC 119 ms
55,904 KB
testcase_21 AC 120 ms
55,576 KB
testcase_22 AC 117 ms
55,988 KB
testcase_23 AC 117 ms
55,712 KB
testcase_24 AC 118 ms
55,800 KB
testcase_25 AC 118 ms
55,792 KB
testcase_26 AC 117 ms
55,740 KB
testcase_27 AC 116 ms
55,616 KB
testcase_28 AC 115 ms
55,940 KB
testcase_29 AC 116 ms
55,916 KB
testcase_30 AC 115 ms
55,924 KB
testcase_31 AC 116 ms
55,836 KB
testcase_32 AC 116 ms
55,860 KB
testcase_33 WA -
testcase_34 AC 117 ms
56,124 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;
		char[] alpha = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

		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] != '/') {
					for(int n=0; n<alpha.length; n++) {
						if(alpha[n] == ch[k]) {
							if(alpha[n] != '/') {
								count++;
								alpha[n] = '/';
							}
						}
					}
					ch[k] = '/';
					ch[m] = '/';
				}
			}
		}

		if(count == 6) {
			for(int l=0; l<13; l++) {
				if(ch[l] != '/') {
						System.out.print(ch[l]);
					}
				}
			}else {
				System.out.println("Impossible");
		}
	}
}
0