結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2015-04-29 00:08:09 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 29 ms / 1,000 ms |
コード長 | 1,624 bytes |
コンパイル時間 | 2,972 ms |
コンパイル使用メモリ | 105,984 KB |
実行使用メモリ | 19,840 KB |
最終ジャッジ日時 | 2024-07-20 03:35:09 |
合計ジャッジ時間 | 5,079 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 43 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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));} }