結果
問題 |
No.383 レーティング
|
ユーザー |
![]() |
提出日時 | 2017-05-03 21:52:10 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 73 ms / 2,000 ms |
コード長 | 824 bytes |
コンパイル時間 | 2,387 ms |
コンパイル使用メモリ | 76,788 KB |
実行使用メモリ | 51,048 KB |
最終ジャッジ日時 | 2024-09-14 07:10:41 |
合計ジャッジ時間 | 4,034 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 14 |
ソースコード
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.stream.Stream; import static java.lang.System.in; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String[] inputs = reader.readLine().split(" "); int a = Integer.parseInt(inputs[0]); int b = Integer.parseInt(inputs[1]); System.out.println(formatRateChange(a,b)); } private static String formatRateChange(int previous, int current) { if(previous==current) { return "0"; } else if (previous < current) { return "+" + (current-previous); } else { return "-" + (previous-current); } } }