結果

問題 No.293 4>7の世界
ユーザー keymoonkeymoon
提出日時 2021-02-01 22:52:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 1,103 bytes
コンパイル時間 2,237 ms
コンパイル使用メモリ 106,548 KB
実行使用メモリ 23,420 KB
最終ジャッジ日時 2023-09-12 10:53:15
合計ジャッジ時間 5,436 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
21,232 KB
testcase_01 AC 55 ms
21,312 KB
testcase_02 AC 56 ms
21,408 KB
testcase_03 AC 54 ms
21,324 KB
testcase_04 AC 54 ms
21,280 KB
testcase_05 AC 55 ms
23,420 KB
testcase_06 AC 54 ms
23,376 KB
testcase_07 AC 55 ms
21,124 KB
testcase_08 AC 55 ms
21,392 KB
testcase_09 AC 54 ms
21,444 KB
testcase_10 AC 55 ms
23,368 KB
testcase_11 AC 54 ms
21,184 KB
testcase_12 AC 54 ms
19,108 KB
testcase_13 AC 54 ms
21,316 KB
testcase_14 AC 55 ms
21,364 KB
testcase_15 AC 54 ms
21,376 KB
testcase_16 AC 55 ms
21,232 KB
testcase_17 AC 55 ms
21,256 KB
testcase_18 AC 55 ms
21,352 KB
testcase_19 AC 54 ms
21,136 KB
testcase_20 AC 54 ms
21,348 KB
testcase_21 AC 55 ms
21,124 KB
testcase_22 AC 55 ms
21,284 KB
testcase_23 AC 55 ms
23,216 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.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        var s = Console.ReadLine().Split();
        var dig = s.Max(x => x.Length);
        s[0] = s[0].PadLeft(dig, '0');
        s[1] = s[1].PadLeft(dig, '0');
        var max = s[0];
        for (int i = 0; i < dig; i++)
        {
            if (s[0][i] == '7' && s[1][i] == '4')
            {
                max = s[1];
                break;
            }
            if (s[0][i] == '4' && s[1][i] == '7')
            {
                max = s[0];
                break;
            }
            if (s[0][i] < s[1][i])
            {
                max = s[1];
                break;
            }
            if (s[0][i] > s[1][i])
            {
                max = s[0];
                break;
            }
        }
        Console.WriteLine(max);
    }
}
0