結果

問題 No.201 yukicoderじゃんけん
ユーザー yun_app
提出日時 2016-05-12 12:15:37
言語 Java
(openjdk 27.0.1.0.3 + ACL)
コンパイル:
javac -J-Duser.language=en -encoding UTF8 -cp /opt/aclib/ac_library.jar _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true -cp .:/opt/aclib/ac_library.jar _class_
結果
AC  
実行時間 48 ms / 5,000 ms
+ 797µs
コード長 1,004 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,227 ms
コンパイル使用メモリ 90,112 KB
実行使用メモリ 40,716 KB
最終ジャッジ日時 2026-11-04 15:37:29
合計ジャッジ時間 5,077 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

/* 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