結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,820 KB
testcase_01 AC 115 ms
56,364 KB
testcase_02 AC 119 ms
55,736 KB
testcase_03 AC 117 ms
55,996 KB
testcase_04 AC 117 ms
56,008 KB
testcase_05 WA -
testcase_06 AC 117 ms
56,116 KB
testcase_07 AC 118 ms
56,016 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 117 ms
55,724 KB
testcase_11 WA -
testcase_12 AC 117 ms
55,704 KB
testcase_13 AC 118 ms
55,952 KB
testcase_14 AC 117 ms
56,284 KB
testcase_15 WA -
testcase_16 AC 118 ms
55,984 KB
testcase_17 WA -
testcase_18 AC 117 ms
56,228 KB
testcase_19 WA -
testcase_20 AC 121 ms
55,404 KB
testcase_21 AC 118 ms
55,668 KB
testcase_22 AC 116 ms
56,120 KB
testcase_23 AC 117 ms
55,784 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{
			System.out.println(getResult(a,b));
		}
	}

	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