結果

問題 No.293 4>7の世界
ユーザー しらゆきしらゆき
提出日時 2015-11-23 13:48:33
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 874 bytes
コンパイル時間 2,393 ms
コンパイル使用メモリ 103,688 KB
実行使用メモリ 22,708 KB
最終ジャッジ日時 2023-08-28 21:56:19
合計ジャッジ時間 4,731 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
20,596 KB
testcase_01 AC 53 ms
22,648 KB
testcase_02 AC 52 ms
20,520 KB
testcase_03 AC 52 ms
20,576 KB
testcase_04 AC 52 ms
22,704 KB
testcase_05 AC 52 ms
20,572 KB
testcase_06 AC 54 ms
20,724 KB
testcase_07 AC 52 ms
20,596 KB
testcase_08 AC 52 ms
20,492 KB
testcase_09 AC 53 ms
20,572 KB
testcase_10 AC 55 ms
22,708 KB
testcase_11 AC 54 ms
20,652 KB
testcase_12 AC 54 ms
20,584 KB
testcase_13 AC 53 ms
20,588 KB
testcase_14 AC 53 ms
20,492 KB
testcase_15 AC 52 ms
20,532 KB
testcase_16 AC 52 ms
22,532 KB
testcase_17 AC 53 ms
22,604 KB
testcase_18 AC 52 ms
20,584 KB
testcase_19 AC 53 ms
22,488 KB
testcase_20 AC 53 ms
20,588 KB
testcase_21 AC 52 ms
22,632 KB
testcase_22 AC 52 ms
20,568 KB
testcase_23 AC 52 ms
18,396 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        var tmp = Console.ReadLine().Split();
        var a = tmp[0];
        var b = tmp[1];

        a = a.PadLeft(Math.Max(a.Length, b.Length), '0');
        b = b.PadLeft(Math.Max(a.Length, b.Length), '0');

        for(int i = 0; i < a.Length; i++)
        {
            if (a[i] == '4' && b[i] == '7')
            {
                Console.WriteLine(tmp[0]);
                break;
            }
            else if (a[i] == '7' && b[i] == '4')
            {
                Console.WriteLine(tmp[1]);
                break;
            }

            if (a[i] > b[i])
            {
                Console.WriteLine(tmp[0]);
                break;
            }
            else if (a[i] < b[i])
            {
                Console.WriteLine(tmp[1]);
                break;
            }
        }
    }
}
0