結果

問題 No.548 国士無双
ユーザー fjafjafjafjafjafja
提出日時 2017-07-31 23:09:31
言語 Java21
(openjdk 21)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 924 bytes
コンパイル時間 6,342 ms
コンパイル使用メモリ 73,824 KB
実行使用メモリ 49,692 KB
最終ジャッジ日時 2023-09-19 08:39:25
合計ジャッジ時間 7,701 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
49,196 KB
testcase_01 AC 44 ms
49,060 KB
testcase_02 AC 44 ms
49,692 KB
testcase_03 AC 46 ms
49,228 KB
testcase_04 AC 44 ms
49,024 KB
testcase_05 AC 44 ms
49,284 KB
testcase_06 AC 44 ms
49,528 KB
testcase_07 AC 45 ms
49,268 KB
testcase_08 AC 44 ms
49,144 KB
testcase_09 AC 44 ms
48,912 KB
testcase_10 AC 45 ms
49,184 KB
testcase_11 AC 44 ms
49,008 KB
testcase_12 AC 46 ms
49,260 KB
testcase_13 AC 45 ms
49,084 KB
testcase_14 AC 45 ms
49,060 KB
testcase_15 AC 45 ms
49,264 KB
testcase_16 AC 45 ms
49,312 KB
testcase_17 AC 45 ms
47,708 KB
testcase_18 AC 45 ms
49,460 KB
testcase_19 AC 46 ms
49,196 KB
testcase_20 AC 45 ms
48,964 KB
testcase_21 AC 44 ms
49,272 KB
testcase_22 RE -
testcase_23 AC 44 ms
49,096 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class N548
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String str=br.readLine();
		int imp=0;
		if(str.length()!=13){imp++;}
		char l='a';
		char ll=' ';
		int len =13;
		int[] buf=new int[len];
		int k=0;
		int db=0;
		char ans=0;
		int count=0;
		while(k<13)
		{
		for(int i=0;i<len;i++)
		{
			if(String.valueOf(l).equals(str.substring(i,i+1))){buf[k]++;count++;}
		}
		if(buf[k]>2){imp=1;k=k+100;}
		if(buf[k]==0){ans=l;}
		if(buf[k]==2){db++;}
		if(db==2){imp=1;k=k+100;}
		l++;k++;
		}
		imp=(count==13)?0:1;
		if(imp==0&&ans!=0)
		{System.out.println(ans);}
		if(imp==0&&ans==0)
		{
			l='a';
			for(int i=0;i<13;i++)
			{
				System.out.println(l);
				l++;
			}
		}
		if(imp==1){System.out.println("Impossible");}
	}
}
0