結果

問題 No.197 手品
ユーザー kuuso1kuuso1
提出日時 2015-04-29 00:08:09
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 1,000 ms
コード長 1,624 bytes
コンパイル時間 4,718 ms
コンパイル使用メモリ 106,820 KB
実行使用メモリ 24,460 KB
最終ジャッジ日時 2023-09-27 09:26:36
合計ジャッジ時間 8,934 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
22,276 KB
testcase_01 AC 60 ms
22,356 KB
testcase_02 AC 59 ms
22,500 KB
testcase_03 AC 59 ms
22,288 KB
testcase_04 AC 59 ms
24,336 KB
testcase_05 AC 59 ms
22,320 KB
testcase_06 AC 58 ms
22,296 KB
testcase_07 AC 59 ms
22,328 KB
testcase_08 AC 59 ms
22,216 KB
testcase_09 AC 59 ms
24,332 KB
testcase_10 AC 61 ms
24,324 KB
testcase_11 AC 60 ms
24,296 KB
testcase_12 AC 58 ms
20,296 KB
testcase_13 AC 59 ms
24,328 KB
testcase_14 AC 61 ms
22,236 KB
testcase_15 AC 59 ms
24,400 KB
testcase_16 AC 59 ms
24,208 KB
testcase_17 AC 59 ms
24,460 KB
testcase_18 AC 59 ms
24,460 KB
testcase_19 AC 59 ms
22,208 KB
testcase_20 AC 59 ms
24,228 KB
testcase_21 AC 59 ms
22,260 KB
testcase_22 AC 60 ms
22,420 KB
testcase_23 AC 58 ms
22,356 KB
testcase_24 AC 60 ms
22,292 KB
testcase_25 AC 59 ms
22,360 KB
testcase_26 AC 59 ms
22,440 KB
testcase_27 AC 59 ms
22,284 KB
testcase_28 AC 58 ms
22,244 KB
testcase_29 AC 59 ms
22,404 KB
testcase_30 AC 59 ms
22,384 KB
testcase_31 AC 60 ms
22,360 KB
testcase_32 AC 59 ms
24,368 KB
testcase_33 AC 59 ms
22,356 KB
testcase_34 AC 59 ms
22,276 KB
testcase_35 AC 59 ms
24,352 KB
testcase_36 AC 59 ms
24,344 KB
testcase_37 AC 59 ms
22,260 KB
testcase_38 AC 59 ms
22,192 KB
testcase_39 AC 58 ms
24,352 KB
testcase_40 AC 58 ms
22,440 KB
testcase_41 AC 60 ms
24,256 KB
testcase_42 AC 59 ms
24,400 KB
testcase_43 AC 59 ms
24,300 KB
testcase_44 AC 59 ms
22,420 KB
testcase_45 AC 59 ms
22,348 KB
testcase_46 AC 61 ms
24,236 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		HashSet<String>[] H=new HashSet<String>[4];
		for(int i=0;i<4;i++)H[i]=new HashSet<String>();
		H[0].Add(S);
		char[] tmp=new char[3];
		
		tmp[0]=S[0];tmp[1]=S[2];tmp[2]=S[1];
		H[1].Add(new String(tmp));
		tmp[0]=S[1];tmp[1]=S[0];tmp[2]=S[2];
		H[1].Add(new String(tmp));
		
		tmp[0]=S[1];tmp[1]=S[2];tmp[2]=S[0];
		H[2].Add(new String(tmp));
		tmp[0]=S[2];tmp[1]=S[0];tmp[2]=S[1];
		H[2].Add(new String(tmp));

		tmp[0]=S[2];tmp[1]=S[1];tmp[2]=S[0];
		H[3].Add(new String(tmp));
		
		bool chk=true;
		
		if(H[0].Contains(T) && N>=0 && N%2==0)chk=false;
		if(H[1].Contains(T) && N>=1 && (N-1)%2==0)chk=false;
		if(H[2].Contains(T) && N>=2 && (N-2)%2==0)chk=false;
		if(H[3].Contains(T) && N>=3 && (N-3)%2==0)chk=false;
		
		Console.WriteLine(chk?"SUCCESS":"FAILURE");
		
		
		
	}
	String S,T;
	int N;
	public Sol(){
		S=rs();
		N=ri();
		T=rs();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}
0