結果

問題 No.138 化石のバージョン
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-06-02 15:30:26
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,390 bytes
コンパイル時間 3,716 ms
コンパイル使用メモリ 76,720 KB
実行使用メモリ 56,700 KB
最終ジャッジ日時 2023-09-20 18:48:24
合計ジャッジ時間 9,881 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,584 KB
testcase_01 AC 125 ms
55,892 KB
testcase_02 AC 126 ms
55,820 KB
testcase_03 WA -
testcase_04 AC 127 ms
55,812 KB
testcase_05 AC 126 ms
55,704 KB
testcase_06 AC 125 ms
55,628 KB
testcase_07 AC 125 ms
55,896 KB
testcase_08 AC 124 ms
55,364 KB
testcase_09 AC 128 ms
55,648 KB
testcase_10 AC 123 ms
55,368 KB
testcase_11 AC 123 ms
55,432 KB
testcase_12 AC 126 ms
55,740 KB
testcase_13 AC 127 ms
55,652 KB
testcase_14 AC 125 ms
55,696 KB
testcase_15 AC 125 ms
55,464 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 RE -
testcase_19 AC 125 ms
55,604 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 125 ms
55,860 KB
testcase_23 AC 126 ms
55,544 KB
testcase_24 AC 122 ms
55,644 KB
testcase_25 AC 122 ms
55,380 KB
testcase_26 AC 124 ms
55,520 KB
testcase_27 AC 124 ms
55,508 KB
testcase_28 AC 122 ms
55,432 KB
testcase_29 AC 124 ms
55,628 KB
testcase_30 AC 124 ms
55,600 KB
testcase_31 AC 124 ms
55,964 KB
testcase_32 AC 124 ms
55,676 KB
testcase_33 AC 124 ms
55,892 KB
testcase_34 AC 124 ms
55,640 KB
testcase_35 AC 124 ms
55,644 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 = Nuki(s1, a, ca1).length() + 2;
		int cb1 = 1;
		int cb2 = Nuki(s2, b, cb1).length() + 2;
		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&&Voa==Vob){
				System.out.println("YES");
				break;
			}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){
				Voa =  Integer.parseInt(Nuki(s1, a, ca2));
				 Vob = Integer.parseInt(Nuki(s2, b, cb2));
			}else if(n==1){
				int ca3 = ca1 + ca2 + 2;
				int cb3 = cb1 + cb2 + 2;
				System.out.println(ca3 + ": " + cb3);
				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){
		if(c>s.length()){
			c = s.length();
		}
		while(!(s.substring(c-1, c)).equals(".")){
			ab+=s.substring(c-1, c);
			if(c==s.length()){
				break;
			}else if(c<s.length()){
				c++;
			}
	}
		return ab;
	}
	}
0