結果

問題 No.138 化石のバージョン
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-06-01 13:59:03
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 957 bytes
コンパイル時間 3,926 ms
コンパイル使用メモリ 82,068 KB
実行使用メモリ 57,792 KB
最終ジャッジ日時 2023-09-20 18:16:33
合計ジャッジ時間 10,058 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,684 KB
testcase_01 AC 132 ms
53,812 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 123 ms
55,768 KB
testcase_05 AC 127 ms
56,056 KB
testcase_06 AC 124 ms
55,672 KB
testcase_07 AC 127 ms
55,744 KB
testcase_08 AC 127 ms
55,492 KB
testcase_09 AC 124 ms
55,512 KB
testcase_10 AC 124 ms
55,692 KB
testcase_11 AC 125 ms
55,848 KB
testcase_12 AC 126 ms
55,952 KB
testcase_13 AC 128 ms
55,488 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 126 ms
55,528 KB
testcase_23 RE -
testcase_24 AC 130 ms
55,756 KB
testcase_25 AC 127 ms
55,664 KB
testcase_26 AC 126 ms
55,748 KB
testcase_27 AC 126 ms
56,264 KB
testcase_28 AC 124 ms
55,480 KB
testcase_29 AC 124 ms
55,916 KB
testcase_30 AC 126 ms
55,496 KB
testcase_31 AC 126 ms
55,864 KB
testcase_32 AC 124 ms
55,756 KB
testcase_33 AC 125 ms
55,708 KB
testcase_34 AC 126 ms
55,980 KB
testcase_35 AC 128 ms
55,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package b2015_5_31;

import java.util.Scanner;

public class KasekiVer {
public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);
	String s1 = sc.nextLine();
	String s2 = sc.nextLine();
	String a = "";
	String b ="";
	int t1 = 0;
	int t2 = 0;
	int n1 = 1;
	int n2 = 1;
	t1 = Integer.parseInt(Nuki(s1, a, n1));
	t2 =  Integer.parseInt(Nuki(s2, b, n2));
	n1+=Nuki(s1, a, n1).length();
	n2+=Nuki(s2, b, n2).length();
	for(int i = 0; i < 3; i++){
		if(t1 > t2){
			System.out.println("YES");
			break;
		}else if(t1 < t2){
			System.out.println("NO");
			break;
		}else if(t1 == t2){
			a = "";
			b ="";
			t1 = 0;
			t2 = 0;
			t1 = Integer.parseInt(Nuki(s1, a, n1));
			t2 =  Integer.parseInt(Nuki(s2, b, n2));
			n1+=Nuki(s1, a, n1).length();
			n2+=Nuki(s2, b, n2).length();
		}
	}
}
public static String Nuki(String s, String ab, int n){
	while(!(s.substring(n-1, n)).equals(".")){
		ab+=s.substring(n-1, n);
		n++;
}
	return ab;
}
}
0