結果

問題 No.293 4>7の世界
ユーザー mbanmban
提出日時 2016-12-23 13:45:10
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 1,437 bytes
コンパイル時間 2,632 ms
コンパイル使用メモリ 102,600 KB
実行使用メモリ 22,652 KB
最終ジャッジ日時 2023-08-28 22:17:20
合計ジャッジ時間 4,919 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
20,484 KB
testcase_01 AC 50 ms
20,620 KB
testcase_02 AC 50 ms
20,716 KB
testcase_03 AC 51 ms
22,524 KB
testcase_04 AC 51 ms
18,428 KB
testcase_05 AC 51 ms
22,516 KB
testcase_06 AC 51 ms
22,636 KB
testcase_07 AC 50 ms
20,612 KB
testcase_08 AC 49 ms
18,416 KB
testcase_09 AC 51 ms
22,652 KB
testcase_10 AC 50 ms
20,416 KB
testcase_11 AC 51 ms
20,672 KB
testcase_12 AC 51 ms
20,628 KB
testcase_13 AC 51 ms
20,608 KB
testcase_14 AC 51 ms
20,652 KB
testcase_15 AC 51 ms
20,688 KB
testcase_16 AC 51 ms
20,620 KB
testcase_17 AC 50 ms
20,536 KB
testcase_18 AC 49 ms
20,596 KB
testcase_19 AC 50 ms
20,688 KB
testcase_20 AC 51 ms
20,656 KB
testcase_21 AC 51 ms
20,708 KB
testcase_22 AC 50 ms
20,660 KB
testcase_23 AC 50 ms
18,364 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.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;

class Magatro
{
    static void Main()
    {
        string[] AB = Console.ReadLine().Split(' ');
        if (Compare(AB[0], AB[1])==1)
        {
            Console.WriteLine(AB[0]);
        }
        else
        {
            Console.WriteLine(AB[1]);
        }
    }
    static int Compare(string A,string B)
    {
        if (A.Length > B.Length)
        {
            return 1;
        }
        else if (A.Length < B.Length)
        {
            return -1;
        }
        for(int i = 0; i < A.Length; i++)
        {
            if (Com(A[i], B[i]) == 1)
            {
                return 1;
            }
            else if (Com(A[i], B[i]) == -1)
            {
                return -1;
            }
            
        }
        return 0;
    }
    static int Com(char a,char b)
    {
        if (a == '4' && b == '7')
        {
            return 1;
        }
        else if (a == '7' && b == '4')
        {
            return -1;
                }
        else
        {
            if (a > b)
            {
                return 1;
                }
            else if(a<b)
            {
                return -1;
            }
            else
            {
                return 0;
            }
        }
    }
  
}

0