結果

問題 No.353 ヘイトプラス
ユーザー mits58mits58
提出日時 2016-07-02 01:04:35
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 1,000 ms
コード長 287 bytes
コンパイル時間 3,573 ms
コンパイル使用メモリ 71,604 KB
実行使用メモリ 56,280 KB
最終ジャッジ日時 2023-09-16 23:43:05
合計ジャッジ時間 5,760 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,872 KB
testcase_01 AC 118 ms
55,940 KB
testcase_02 AC 119 ms
56,148 KB
testcase_03 AC 121 ms
55,632 KB
testcase_04 AC 118 ms
55,912 KB
testcase_05 AC 119 ms
56,280 KB
testcase_06 AC 118 ms
55,884 KB
testcase_07 AC 117 ms
55,580 KB
testcase_08 AC 120 ms
56,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			long a=sc.nextLong();
			long b=sc.nextLong();
			if(a==b) System.out.println(2*a);
			else System.out.println((a*a-b*b)/(a-b));
		}
	}
}
0