結果

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

ソースコード

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