結果

問題 No.138 化石のバージョン
ユーザー AoiroFukurouAoiroFukurou
提出日時 2015-06-02 13:22:00
言語 Java21
(openjdk 21)
結果
TLE  
実行時間 -
コード長 1,163 bytes
コンパイル時間 3,426 ms
コンパイル使用メモリ 82,332 KB
実行使用メモリ 69,312 KB
最終ジャッジ日時 2023-09-20 18:42:35
合計ジャッジ時間 15,943 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

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() + 1;
	int cb1 = 1;
	int cb2 = Nuki(s2, b, cb1).length() + 1;
	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){
			Voa =  Integer.parseInt(Nuki(s1, a, ca2));
			 Vob = Integer.parseInt(Nuki(s2, b, cb2));
		}else if(n==1){
			int ca3 = ca2 + 1;
			int cb3 = cb2 + 1;
			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);
}
	return ab;
}
}
0