結果
問題 | No.197 手品 |
ユーザー |
![]() |
提出日時 | 2015-06-07 19:43:42 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 1,000 ms |
コード長 | 2,427 bytes |
コンパイル時間 | 2,213 ms |
コンパイル使用メモリ | 105,984 KB |
実行使用メモリ | 17,792 KB |
最終ジャッジ日時 | 2024-07-20 03:40:58 |
合計ジャッジ時間 | 4,257 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace foryuki { class Program { static void Main(string[] args) { char[] c1 = Console.ReadLine().ToCharArray(); int N = int.Parse(Console.ReadLine()); char[] c2 = Console.ReadLine().ToCharArray(); int cnt = 0; foreach (var item in c1) { if (item == 'o') cnt++; } foreach (var item in c2) { if (item == 'o') cnt--; } if (cnt != 0) { Console.WriteLine("SUCCESS"); return; } //--------------------------------------------- if (N >= 2) { Console.WriteLine("FAILURE"); return; } //---------------------------------------------- string w1 = ""; string w2 = ""; if (N == 0) { w1 = "" + c1[0] + c1[1] + c1[2]; w2 = "" + c2[0] + c2[1] + c2[2]; if (w1 == w2) { Console.WriteLine("FAILURE"); return; } else { Console.WriteLine("SUCCESS"); return; } } //---------------------------------------------- w1 = "" + c1[1] + c1[0] + c1[2]; w2 = "" + c1[0] + c1[2] + c1[1]; string w3 = "" + c2[0] + c2[1] + c2[2]; if (w3 == w1 || w3 == w2) { Console.WriteLine("FAILURE"); return; } else { Console.WriteLine("SUCCESS"); return; } } //------------------------------------------------------------- static int[] ConvertStringArrayToIntArray(string[] str, int defaultValue) { int[] b = Array.ConvertAll<string, int>(str, delegate(string value) { return int.Parse(value); }); for (int i = 0; i < b.Length; i++) { b[i] = defaultValue; } return b; } } }