結果

問題 No.138 化石のバージョン
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-06-01 14:10:40
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,064 bytes
コンパイル時間 3,748 ms
コンパイル使用メモリ 76,056 KB
実行使用メモリ 58,304 KB
最終ジャッジ日時 2023-09-20 18:18:55
合計ジャッジ時間 9,655 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,764 KB
testcase_01 AC 122 ms
55,692 KB
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 120 ms
55,856 KB
testcase_05 AC 131 ms
55,500 KB
testcase_06 AC 129 ms
55,700 KB
testcase_07 AC 121 ms
55,748 KB
testcase_08 AC 121 ms
55,992 KB
testcase_09 AC 122 ms
56,008 KB
testcase_10 AC 119 ms
55,632 KB
testcase_11 AC 119 ms
55,644 KB
testcase_12 AC 120 ms
55,904 KB
testcase_13 AC 119 ms
56,064 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 124 ms
56,004 KB
testcase_23 RE -
testcase_24 AC 123 ms
55,928 KB
testcase_25 AC 122 ms
55,784 KB
testcase_26 AC 123 ms
55,852 KB
testcase_27 AC 124 ms
55,964 KB
testcase_28 AC 123 ms
55,696 KB
testcase_29 AC 122 ms
55,492 KB
testcase_30 AC 122 ms
55,760 KB
testcase_31 AC 124 ms
55,516 KB
testcase_32 AC 123 ms
55,936 KB
testcase_33 AC 123 ms
55,940 KB
testcase_34 AC 123 ms
55,612 KB
testcase_35 AC 122 ms
55,984 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 < 4; i++){
		if(n3==3){
			System.out.println("YES");
			break;
		}else 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