結果
問題 | No.208 王将 |
ユーザー |
|
提出日時 | 2020-02-18 17:23:47 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 135 ms / 1,000 ms |
コード長 | 556 bytes |
コンパイル時間 | 2,283 ms |
コンパイル使用メモリ | 74,972 KB |
実行使用メモリ | 54,140 KB |
最終ジャッジ日時 | 2024-10-06 15:39:33 |
合計ジャッジ時間 | 6,767 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 23 |
ソースコード
import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; class Main { public static void main(String[] args) throws Exception { new Main().run(); } void run() { Scanner sc=new Scanner(System.in); long x=sc.nextLong(); long y=sc.nextLong(); long x1=sc.nextLong(); long y1=sc.nextLong(); long ans=Math.min(x, y)+Math.max(x, y)-Math.min(x, y); if(x==y&&x>x1&&y>y1&&x1==y1) { ++ans; } System.out.println(ans); } static void tr(Object... objects) { System.out.println(Arrays.deepToString(objects)); } }