結果

問題 No.293 4>7の世界
ユーザー GrenacheGrenache
提出日時 2015-10-23 22:37:39
言語 Java19
(openjdk 21)
結果
AC  
実行時間 123 ms / 2,000 ms
コード長 969 bytes
コンパイル時間 3,238 ms
コンパイル使用メモリ 72,772 KB
実行使用メモリ 56,072 KB
最終ジャッジ日時 2023-08-28 21:49:15
合計ジャッジ時間 7,462 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,792 KB
testcase_01 AC 119 ms
55,688 KB
testcase_02 AC 121 ms
55,864 KB
testcase_03 AC 119 ms
55,800 KB
testcase_04 AC 120 ms
55,980 KB
testcase_05 AC 121 ms
55,740 KB
testcase_06 AC 119 ms
55,944 KB
testcase_07 AC 118 ms
56,016 KB
testcase_08 AC 120 ms
55,472 KB
testcase_09 AC 120 ms
55,456 KB
testcase_10 AC 123 ms
55,556 KB
testcase_11 AC 120 ms
55,724 KB
testcase_12 AC 123 ms
55,724 KB
testcase_13 AC 120 ms
54,068 KB
testcase_14 AC 120 ms
55,740 KB
testcase_15 AC 120 ms
55,856 KB
testcase_16 AC 120 ms
55,864 KB
testcase_17 AC 119 ms
55,872 KB
testcase_18 AC 119 ms
55,552 KB
testcase_19 AC 118 ms
55,632 KB
testcase_20 AC 120 ms
55,980 KB
testcase_21 AC 120 ms
55,848 KB
testcase_22 AC 120 ms
56,072 KB
testcase_23 AC 119 ms
55,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;


public class Main_yukicoder293 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        char[] a = sc.next().toCharArray();
        char[] b = sc.next().toCharArray();

        if (a.length > b.length) {
        	System.out.println(a);
        } else if (a.length < b.length) {
        	System.out.println(b);
        } else {
        	for (int i = 0; i < a.length; i++) {
        		if (a[i] != b[i]) {
        			if (a[i] == '4' && b[i] == '7') {
        	        	System.out.println(a);
        	        	break;
        			} else if (a[i] == '7' && b[i] == '4') {
        	        	System.out.println(b);
        	        	break;
        			} else if (a[i] > b[i]) {
        	        	System.out.println(a);
        	        	break;
        			} else {
        	        	System.out.println(b);
        	        	break;
        			}
        		}
        	}
        }

        sc.close();
    }
}
0