結果

問題 No.353 ヘイトプラス
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-17 02:04:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 473 bytes
コンパイル時間 4,444 ms
コンパイル使用メモリ 72,292 KB
実行使用メモリ 56,208 KB
最終ジャッジ日時 2023-09-06 01:34:32
合計ジャッジ時間 5,930 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 129 ms
55,748 KB
testcase_02 AC 129 ms
55,844 KB
testcase_03 AC 128 ms
55,780 KB
testcase_04 AC 127 ms
55,788 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 126 ms
56,208 KB
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class No353 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		if(A-B != 0) {
			System.out.println((A*A - B*B) / (A-B));
		}else if(A == 0 && B != 0) {
			System.out.println(B);
		}else if(A != 0 && B == 0) {
			System.out.println(A);
		}else if(A != 0 && B != 0 && A - B == 0) {
			System.out.println(A*2);
		}else {
			System.out.println(0);
		}
	}
}
0