結果

問題 No.587 七対子
ユーザー uafr_csuafr_cs
提出日時 2017-11-03 22:25:16
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 723 bytes
コンパイル時間 2,128 ms
コンパイル使用メモリ 71,948 KB
実行使用メモリ 56,080 KB
最終ジャッジ日時 2023-09-27 02:07:06
合計ジャッジ時間 7,750 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,576 KB
testcase_01 AC 118 ms
56,080 KB
testcase_02 AC 120 ms
55,532 KB
testcase_03 AC 119 ms
55,720 KB
testcase_04 AC 119 ms
55,580 KB
testcase_05 AC 120 ms
55,528 KB
testcase_06 AC 118 ms
55,492 KB
testcase_07 AC 120 ms
55,544 KB
testcase_08 AC 119 ms
55,248 KB
testcase_09 AC 118 ms
55,524 KB
testcase_10 AC 121 ms
55,260 KB
testcase_11 AC 120 ms
55,488 KB
testcase_12 AC 119 ms
55,624 KB
testcase_13 AC 119 ms
55,432 KB
testcase_14 AC 119 ms
55,464 KB
testcase_15 AC 119 ms
55,556 KB
testcase_16 AC 118 ms
55,716 KB
testcase_17 AC 116 ms
55,572 KB
testcase_18 AC 119 ms
55,652 KB
testcase_19 AC 119 ms
55,528 KB
testcase_20 AC 120 ms
55,788 KB
testcase_21 AC 118 ms
55,252 KB
testcase_22 AC 118 ms
55,572 KB
testcase_23 AC 118 ms
55,676 KB
testcase_24 AC 120 ms
55,416 KB
testcase_25 AC 123 ms
53,728 KB
testcase_26 AC 120 ms
55,468 KB
testcase_27 AC 119 ms
55,724 KB
testcase_28 AC 120 ms
55,472 KB
testcase_29 AC 120 ms
55,256 KB
testcase_30 AC 121 ms
55,488 KB
testcase_31 AC 121 ms
55,808 KB
testcase_32 AC 121 ms
55,252 KB
testcase_33 AC 121 ms
55,440 KB
testcase_34 AC 121 ms
53,160 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static long MOD = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] alpha = new char[26];
		for(final char ch : sc.next().toCharArray()){
			alpha[ch - 'a']++;
		}
		
		int two_count = 0, one_count = 0;
		for(final int a : alpha){
			if(a == 2){ 
				two_count++;
			}else if(a == 1){
				one_count++;
			}
		}
		
		if(two_count == 6 && one_count == 1){
			for(int i = 0; i < 26; i++){
				if(alpha[i] == 1){
					System.out.println((char)(i + 'a'));
					return;
				}
			}
		}else{
			System.out.println("Impossible");
		}
	}
}
0