結果

問題 No.197 手品
ユーザー mban
提出日時 2016-12-25 11:17:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 21 ms / 1,000 ms
コード長 1,268 bytes
コンパイル時間 829 ms
コンパイル使用メモリ 105,088 KB
実行使用メモリ 17,664 KB
最終ジャッジ日時 2024-07-20 03:50:29
合計ジャッジ時間 2,814 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;

class Magatro
{
    static string B = Console.ReadLine();
    static int N = int.Parse(Console.ReadLine());
    static string A = Console.ReadLine();
    static void Main()
    {
        int tempa = 0;
        int tempb = 0;
      for(int i = 0; i < 3; i++)
        {
            if (B[i] == 'o') tempb++;
            else tempb--;
            if (A[i] == 'o') tempa++;
            else tempa--;
        }
        if (tempa != tempb)
        {
            Console.WriteLine("SUCCESS");
            return;
        }
        if (N == 0)
        {
            if (B == A)
            {
                Console.WriteLine("FAILURE");
                return;
            }
            else
            {
                Console.WriteLine("SUCCESS");
            }
        }
        else if (N == 1)
        {
            if((A[0]==B[0]&&A[1]==B[2]&&A[2]==B[1])|| (A[2] == B[2] && A[1] == B[0] && A[0] == B[1])) Console.WriteLine("FAILURE");
            else Console.WriteLine("SUCCESS");
        }
        else
        {
            Console.WriteLine("FAILURE");
        }
    }

}


0