結果

問題 No.353 ヘイトプラス
ユーザー dnish
提出日時 2017-01-11 12:33:52
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 195 bytes
コンパイル時間 751 ms
コンパイル使用メモリ 54,956 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-03 22:26:02
合計ジャッジ時間 983 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
using namespace std;

int main() {
	long long int A,B,ans;
	cin>>A>>B;
	if(A==B){
		ans=2*A;
	}else{
		ans=(A*A-B*B)/(A-B);
	}
	cout<<ans<<endl;
	return 0;
}
0