結果

問題 No.208 王将
ユーザー rf141rf141
提出日時 2015-08-13 00:46:53
言語 Java21
(openjdk 21)
結果
AC  
実行時間 130 ms / 1,000 ms
コード長 564 bytes
コンパイル時間 3,368 ms
コンパイル使用メモリ 75,140 KB
実行使用メモリ 41,676 KB
最終ジャッジ日時 2024-04-17 22:44:00
合計ジャッジ時間 7,172 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
39,944 KB
testcase_01 AC 127 ms
41,232 KB
testcase_02 AC 115 ms
41,376 KB
testcase_03 AC 130 ms
41,676 KB
testcase_04 AC 126 ms
41,120 KB
testcase_05 AC 128 ms
41,140 KB
testcase_06 AC 128 ms
41,220 KB
testcase_07 AC 129 ms
41,676 KB
testcase_08 AC 130 ms
41,480 KB
testcase_09 AC 126 ms
41,660 KB
testcase_10 AC 127 ms
41,172 KB
testcase_11 AC 126 ms
41,208 KB
testcase_12 AC 127 ms
41,336 KB
testcase_13 AC 127 ms
41,332 KB
testcase_14 AC 129 ms
41,648 KB
testcase_15 AC 128 ms
41,424 KB
testcase_16 AC 115 ms
41,136 KB
testcase_17 AC 126 ms
41,164 KB
testcase_18 AC 127 ms
41,336 KB
testcase_19 AC 126 ms
41,104 KB
testcase_20 AC 125 ms
41,284 KB
testcase_21 AC 128 ms
41,408 KB
testcase_22 AC 128 ms
41,276 KB
testcase_23 AC 128 ms
41,020 KB
testcase_24 AC 126 ms
41,368 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Osho{
	public static void main(String... args){
		Scanner scan = new Scanner(System.in);
		int x=scan.nextInt(),y=scan.nextInt(),x1=scan.nextInt(),y1=scan.nextInt();
		int res = Math.max(x,y);
		if(Math.abs(x) == Math.abs(y) && Math.abs(x1) == Math.abs(y1) && Math.abs(x) > Math.abs(x1)){
			if(x>0 && y>0 && x1>0 && y1>0){
				res++;
			}else if(x>0 && y<0 && x1>0 && y1<0){
				res++;
			}else if(x<0 && y>0 && x1<0 && y1>0){
				res++;
			}else if(x<0 && y<0 && x1<0 && y1<0){
				res++;
			}
		}
		System.out.println(res);
	}
}
0