結果
問題 |
No.8032 Unavailability of Inequality Signs
|
ユーザー |
|
提出日時 | 2018-04-01 22:20:44 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 152 ms / 2,000 ms |
コード長 | 960 bytes |
コンパイル時間 | 4,236 ms |
コンパイル使用メモリ | 76,576 KB |
実行使用メモリ | 41,724 KB |
最終ジャッジ日時 | 2024-06-26 05:51:49 |
合計ジャッジ時間 | 5,671 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
ソースコード
import java.io.*; import java.util.*; public class Main_yukicoder3032 { private static Scanner sc; private static Printer pr; private static void solve() { char lt = (char)('=' - 1); char gt = (char)('=' + 1); int n = sc.nextInt(); for (int i = 0; i != n; i++) { int a = sc.nextInt(); int b = sc.nextInt(); int comp = Integer.compare(a, b); if (comp == 0) { pr.println('='); } else if (Integer.toString(comp).toCharArray()[0] == '-') { pr.println(lt); } else { pr.println(gt); } } } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes())); pr = new Printer(System.out); solve(); // pr.close(); pr.flush(); // sc.close(); } static String INPUT = null; private static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }