結果

問題 No.293 4>7の世界
ユーザー rf141rf141
提出日時 2015-12-19 18:50:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 697 bytes
コンパイル時間 4,447 ms
コンパイル使用メモリ 71,620 KB
実行使用メモリ 56,192 KB
最終ジャッジ日時 2023-10-14 22:33:49
合計ジャッジ時間 6,323 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,000 KB
testcase_01 AC 127 ms
55,564 KB
testcase_02 AC 126 ms
55,588 KB
testcase_03 AC 127 ms
56,192 KB
testcase_04 AC 127 ms
55,920 KB
testcase_05 WA -
testcase_06 AC 128 ms
55,688 KB
testcase_07 AC 126 ms
56,004 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 129 ms
55,332 KB
testcase_11 WA -
testcase_12 AC 127 ms
55,868 KB
testcase_13 AC 127 ms
55,792 KB
testcase_14 AC 127 ms
55,796 KB
testcase_15 WA -
testcase_16 AC 127 ms
55,532 KB
testcase_17 WA -
testcase_18 AC 129 ms
55,548 KB
testcase_19 WA -
testcase_20 AC 128 ms
55,316 KB
testcase_21 AC 127 ms
53,540 KB
testcase_22 AC 127 ms
55,724 KB
testcase_23 AC 127 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;
		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