結果

問題 No.138 化石のバージョン
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-06-02 14:22:29
言語 Java21
(openjdk 21)
結果
RE  
実行時間 -
コード長 1,244 bytes
コンパイル時間 3,402 ms
コンパイル使用メモリ 77,244 KB
実行使用メモリ 56,416 KB
最終ジャッジ日時 2023-09-20 18:45:36
合計ジャッジ時間 9,291 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,796 KB
testcase_01 AC 121 ms
55,840 KB
testcase_02 AC 121 ms
55,836 KB
testcase_03 RE -
testcase_04 AC 120 ms
55,996 KB
testcase_05 AC 127 ms
55,628 KB
testcase_06 AC 120 ms
55,616 KB
testcase_07 AC 124 ms
55,636 KB
testcase_08 AC 122 ms
55,804 KB
testcase_09 AC 121 ms
55,816 KB
testcase_10 AC 121 ms
54,124 KB
testcase_11 AC 121 ms
55,588 KB
testcase_12 AC 124 ms
55,916 KB
testcase_13 AC 122 ms
55,572 KB
testcase_14 AC 124 ms
55,704 KB
testcase_15 AC 124 ms
55,408 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 122 ms
55,824 KB
testcase_19 AC 127 ms
55,632 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 121 ms
55,916 KB
testcase_23 AC 120 ms
55,664 KB
testcase_24 AC 120 ms
55,444 KB
testcase_25 AC 119 ms
55,564 KB
testcase_26 AC 121 ms
55,452 KB
testcase_27 AC 121 ms
55,492 KB
testcase_28 AC 121 ms
55,376 KB
testcase_29 AC 121 ms
55,400 KB
testcase_30 AC 122 ms
55,784 KB
testcase_31 AC 122 ms
55,840 KB
testcase_32 AC 121 ms
55,804 KB
testcase_33 AC 124 ms
55,812 KB
testcase_34 AC 121 ms
55,544 KB
testcase_35 AC 124 ms
55,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package b2015_5_31;

import java.util.Scanner;

public class KasekiVer3 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s1 = sc.nextLine();
		String s2 = sc.nextLine();
		sc.close();
		String a = "";
		String b = "";
		int ca1 = 1;
		int ca2 = 0;
		int cb1 = 1;
		int cb2 = 0;
		int Voa = Integer.parseInt(Nuki(s1, a, ca1));
		int Vob = Integer.parseInt(Nuki(s2, b, cb1));
		int n = 0;
		for(int i = 0; i<4; i++){
			if(n==2){
				System.out.println("YES");
				break;
			}else if(Voa >Vob){
				System.out.println("YES");
				break;
			}else if(Voa < Vob){
				System.out.println("NO");
				break;
			}else if(Voa==Vob){
			a = "";
			b = "";
			Voa = 0;
			Vob = 0;
			if(n==0){
				ca2 = Nuki(s1, a, ca1).length() + 2;
				cb2 = Nuki(s2, b, cb1).length() + 2;
				Voa =  Integer.parseInt(Nuki(s1, a, ca2));
				 Vob = Integer.parseInt(Nuki(s2, b, cb2));
			}else if(n==1){
				int ca3 = ca2 + 2;
				int cb3 = cb2 + 2;
				Voa =  Integer.parseInt(Nuki(s1, a, ca3));
				 Vob = Integer.parseInt(Nuki(s2, b, cb3));
			}
			n++;
			}
		}
	}
	public static String Nuki(String s, String ab, int c){
		while(!(s.substring(c-1, c)).equals(".")){
			ab+=s.substring(c-1, c);
			c++;
	}
		return ab;
	}
	}
0