結果

問題 No.293 4>7の世界
コンテスト
ユーザー 37zigen
提出日時 2016-05-03 23:14:39
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 786 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,498 ms
コンパイル使用メモリ 82,580 KB
実行使用メモリ 41,500 KB
最終ジャッジ日時 2026-06-04 01:52:58
合計ジャッジ時間 4,907 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package yukicoder;
import java.util.Scanner;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner(System.in);
		String s1=sc.next();
		String s2=sc.next();
		char[] c1=s1.toCharArray();
		char[] c2=s2.toCharArray();
		if(c1.length>c2.length){
			System.out.println(s1);
		}else if(c1.length<c2.length){
			System.out.println(s2);
		}else if(c1.length==c2.length){
			for(int i=0;i<c1.length;i++){
				if(c1[i]=='4'&&c2[i]=='7'){
					System.out.println(s1);
				}else if(c1[i]=='7'&&c2[i]=='4'){
					System.out.println(s2);
				}else if(c1[i]>c2[i]){
					System.out.println(s1);
				}else if(c1[i]<c2[i]){
					System.out.println(s2);
				}else{
					continue;
				}
				return;
			}
		}
		
	}
}
0