結果

問題 No.197 手品
ユーザー nanophoto12
提出日時 2015-05-04 23:31:32
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,401 bytes
コンパイル時間 2,758 ms
コンパイル使用メモリ 111,172 KB
実行使用メモリ 26,776 KB
最終ジャッジ日時 2024-06-27 09:35:35
合計ジャッジ時間 4,404 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 37 WA * 6
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

namespace YukicoderSource
{
    class Program
    {
        static void Main(string[] args)
        {
            var before = Console.ReadLine();
            var n = long.Parse(Console.ReadLine());
            var after = Console.ReadLine();
            var success = "SUCCESS";
            if (before.Count(element => element.Equals('o')) != after.Count(element => element.Equals('o')))
            {
                Console.WriteLine(success);
                return;
            }
            var failure = "FAILURE";
            if (n >= 2)
            {
                Console.WriteLine(failure);
                return;                
            }
            if (n == 1)
            {
                if (before.Equals(after))
                {
                    Console.WriteLine(success);
                    return;
                }
                if (before[1] != after[1])
                {
                    Console.WriteLine(failure);
                    return;                    
                }
                Console.WriteLine(success);
                return;                                    
            }
            if (before.Equals(after))
            {
                Console.WriteLine(failure);
                return;                                
            }
            Console.WriteLine(success);
        }
    }
}
0