結果

問題 No.201 yukicoderじゃんけん
ユーザー yun_app
提出日時 2016-05-12 12:15:37
言語 Java
(openjdk 23)
結果
AC  
実行時間 51 ms / 5,000 ms
コード長 1,004 bytes
コンパイル時間 1,829 ms
コンパイル使用メモリ 75,080 KB
実行使用メモリ 37,424 KB
最終ジャッジ日時 2024-10-05 13:54:50
合計ジャッジ時間 3,529 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] lines = br.readLine().split(" ");
        String aname  = lines[0];
        String apoint = lines[1];

        lines = br.readLine().split(" ");
        String bname  = lines[0];
        String bpoint = lines[1];
        
        if(apoint.equals(bpoint)){
            System.out.println(-1);
        }else{
            System.out.println(compare(apoint,bpoint)<0?bname:aname);
        }
    }
    
    public static int compare(String a,String b){
        if(a.length() != b.length()){
            return a.length() - b.length();
        }else{
            return a.compareTo(b);
        }
    }

}
0