結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー swdamdrswdamdr
提出日時 2017-01-26 13:03:36
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 868 bytes
コンパイル時間 4,117 ms
コンパイル使用メモリ 103,392 KB
実行使用メモリ 22,764 KB
最終ジャッジ日時 2023-08-24 23:56:39
合計ジャッジ時間 4,319 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
20,696 KB
testcase_01 AC 52 ms
20,872 KB
testcase_02 AC 51 ms
20,684 KB
testcase_03 AC 52 ms
22,656 KB
testcase_04 AC 51 ms
20,764 KB
testcase_05 AC 51 ms
20,716 KB
testcase_06 WA -
testcase_07 AC 52 ms
22,676 KB
testcase_08 WA -
testcase_09 AC 53 ms
20,760 KB
testcase_10 AC 52 ms
22,764 KB
testcase_11 AC 50 ms
20,696 KB
testcase_12 AC 51 ms
20,692 KB
testcase_13 AC 52 ms
22,740 KB
testcase_14 AC 51 ms
20,800 KB
testcase_15 AC 52 ms
18,636 KB
testcase_16 AC 52 ms
20,692 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string a = Console.ReadLine();
        string b = Console.ReadLine();

        if (Judge(a, b))
        {
            Console.WriteLine("OK");
        }
        else
        {
            Console.WriteLine("NG");
        }

        Console.Read();
    }

    static bool Judge(string a, string b)
    {
        int i;
        string n = a;
        string m = b;

        if (!int.TryParse(a, out i) || !int.TryParse(b, out i))
        {
            return false;
        }

        if (a != "0")
        {
            n = a.TrimStart('0');
        }
        if (b != "0")
        {
            m = b.TrimStart('0');
        }

        if (a != n || b != m)
        {
            return false;
        }

        return true;
    }
}

0