結果

問題 No.353 ヘイトプラス
ユーザー aaaaasatoriaaaaasatori
提出日時 2018-02-17 02:03:01
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 4,870 ms
コンパイル使用メモリ 72,008 KB
実行使用メモリ 56,140 KB
最終ジャッジ日時 2023-09-06 01:31:28
合計ジャッジ時間 6,036 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 134 ms
55,536 KB
testcase_02 AC 134 ms
55,824 KB
testcase_03 AC 135 ms
55,980 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 127 ms
55,808 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 {
			System.out.println(0);
		}
	}
}
0