結果

問題 No.138 化石のバージョン
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-06-01 14:07:25
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,052 bytes
コンパイル時間 3,727 ms
コンパイル使用メモリ 79,488 KB
実行使用メモリ 56,332 KB
最終ジャッジ日時 2023-09-20 18:17:51
合計ジャッジ時間 9,841 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
39,988 KB
testcase_01 AC 122 ms
39,624 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 121 ms
39,552 KB
testcase_05 AC 122 ms
39,656 KB
testcase_06 AC 124 ms
40,004 KB
testcase_07 AC 124 ms
39,984 KB
testcase_08 AC 125 ms
39,932 KB
testcase_09 AC 124 ms
39,384 KB
testcase_10 AC 124 ms
39,540 KB
testcase_11 AC 126 ms
39,672 KB
testcase_12 AC 125 ms
39,596 KB
testcase_13 AC 122 ms
39,244 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 120 ms
40,052 KB
testcase_23 RE -
testcase_24 AC 121 ms
39,908 KB
testcase_25 AC 122 ms
39,392 KB
testcase_26 AC 122 ms
40,044 KB
testcase_27 AC 122 ms
39,324 KB
testcase_28 AC 121 ms
39,672 KB
testcase_29 AC 122 ms
39,756 KB
testcase_30 AC 122 ms
39,560 KB
testcase_31 AC 122 ms
39,948 KB
testcase_32 AC 122 ms
39,808 KB
testcase_33 AC 123 ms
39,360 KB
testcase_34 AC 123 ms
39,788 KB
testcase_35 AC 122 ms
39,764 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 t3 = 0;
	int t4 = 0;
	int n1 = 1;
	int n2 = 1;
	int n3 = 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();
	for(int i = 0; i < 3; i++){
		if(n3==3){
			System.out.println("YES");
		}
		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();
			n3++;
		}
	}
}
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