結果
| 問題 |
No.197 手品
|
| コンテスト | |
| ユーザー |
kuuso1
|
| 提出日時 | 2015-04-29 00:06:58 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,616 bytes |
| コンパイル時間 | 987 ms |
| コンパイル使用メモリ | 115,612 KB |
| 実行使用メモリ | 27,884 KB |
| 最終ジャッジ日時 | 2024-06-27 07:34:48 |
| 合計ジャッジ時間 | 3,785 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 35 WA * 8 |
コンパイルメッセージ
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%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[1].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));}
}
kuuso1