結果
問題 | No.293 4>7の世界 |
ユーザー |
![]() |
提出日時 | 2016-01-09 10:01:27 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 62 ms / 2,000 ms |
コード長 | 739 bytes |
コンパイル時間 | 2,625 ms |
コンパイル使用メモリ | 74,576 KB |
実行使用メモリ | 37,168 KB |
最終ジャッジ日時 | 2024-12-30 11:48:17 |
合計ジャッジ時間 | 5,406 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 20 |
ソースコード
import java.io.*; import java.util.*; class Main { public static void out (Object o) { System.out.println(o); } public static String max (String a , String b) { if (a.length() != b.length()) return a.length() > b.length() ? a : b; for (int i = 0; i < a.length(); i++) { int n = a.charAt(i) - '0'; int m = b.charAt(i) - '0'; if (n == 4 && m == 7) { return a; } else if (n == 7 && m == 4) { return b; } else if (n != m) { return n > m ? a : b; } } return a; } public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] line = br.readLine().split(" "); out(max(line[0] , line[1])); } }