結果
問題 | No.201 yukicoderじゃんけん |
ユーザー | dazy |
提出日時 | 2017-02-23 16:06:24 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 157 ms / 5,000 ms |
コード長 | 978 bytes |
コンパイル時間 | 3,546 ms |
コンパイル使用メモリ | 72,044 KB |
実行使用メモリ | 56,676 KB |
最終ジャッジ日時 | 2023-08-30 21:28:21 |
合計ジャッジ時間 | 7,655 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 113 ms
55,996 KB |
testcase_01 | AC | 112 ms
55,796 KB |
testcase_02 | AC | 113 ms
55,444 KB |
testcase_03 | AC | 118 ms
55,952 KB |
testcase_04 | AC | 116 ms
56,012 KB |
testcase_05 | AC | 117 ms
55,576 KB |
testcase_06 | AC | 118 ms
55,708 KB |
testcase_07 | AC | 114 ms
55,828 KB |
testcase_08 | AC | 120 ms
56,448 KB |
testcase_09 | AC | 123 ms
55,648 KB |
testcase_10 | AC | 117 ms
55,692 KB |
testcase_11 | AC | 119 ms
55,668 KB |
testcase_12 | AC | 123 ms
55,864 KB |
testcase_13 | AC | 123 ms
55,852 KB |
testcase_14 | AC | 118 ms
56,200 KB |
testcase_15 | AC | 157 ms
56,404 KB |
testcase_16 | AC | 156 ms
56,080 KB |
testcase_17 | AC | 157 ms
56,576 KB |
testcase_18 | AC | 148 ms
56,676 KB |
testcase_19 | AC | 151 ms
56,656 KB |
ソースコード
import java.util.*; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); String ans = "-1"; String A = scan.next(); String a = scan.next(); String trash = scan.next(); String B = scan.next(); String b = scan.next(); trash = scan.next(); if (a.length() > b.length()) ans = A; else if (b.length() > a.length()) ans = B; else if (a.equals(b)) { } else { int X, Y; for (int i = 0; i < a.length(); i++) { X = Integer.parseInt(a.substring(i, i+1)); Y = Integer.parseInt(b.substring(i, i+1)); if (X > Y) { ans = A; break; } else if (Y > X) { ans = B; break; } else { } } } System.out.println(ans); } }