結果

問題 No.293 4>7の世界
ユーザー rf141rf141
提出日時 2015-12-19 19:02:53
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 761 bytes
コンパイル時間 1,927 ms
コンパイル使用メモリ 70,852 KB
実行使用メモリ 56,328 KB
最終ジャッジ日時 2023-10-14 22:33:56
合計ジャッジ時間 5,804 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,620 KB
testcase_01 AC 116 ms
55,836 KB
testcase_02 AC 117 ms
55,564 KB
testcase_03 AC 119 ms
55,584 KB
testcase_04 AC 117 ms
55,740 KB
testcase_05 WA -
testcase_06 AC 119 ms
55,508 KB
testcase_07 AC 117 ms
55,692 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 118 ms
55,920 KB
testcase_11 WA -
testcase_12 AC 123 ms
55,692 KB
testcase_13 AC 117 ms
55,552 KB
testcase_14 AC 118 ms
55,928 KB
testcase_15 AC 120 ms
55,600 KB
testcase_16 AC 119 ms
55,516 KB
testcase_17 WA -
testcase_18 AC 118 ms
55,308 KB
testcase_19 AC 118 ms
55,620 KB
testcase_20 AC 116 ms
55,964 KB
testcase_21 AC 119 ms
55,520 KB
testcase_22 AC 121 ms
55,868 KB
testcase_23 AC 119 ms
55,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Main{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();

		if(a < b){
			System.out.println(getResult(b,a));
		}else if(b < a){
			System.out.println(getResult(a,b));
		}else{
			System.out.println(a);
		}
	}

	public static int getResult(int l,int s){
		String l_s = String.valueOf(l);
		String s_s = String.valueOf(s);
		if(l_s.length() != s_s.length())return l;
		if(l_s.indexOf("7") == -1 && s_s.indexOf("7") == -1)return l;
		int result = 0;
		for(int i = 0; i < l_s.length(); i++){
			if(l_s.charAt(i) == '4'){
				result = l;
				break;
			}else if(s_s.charAt(i) == '4'){
				result = s;
				break;
			}
		}

		return result;
	}
}
0