結果

問題 No.2239 Friday
ユーザー Kome_soudou
提出日時 2023-03-10 21:36:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 1,647 ms
コンパイル使用メモリ 166,044 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-18 03:49:02
合計ジャッジ時間 2,236 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int a, b;
	cin >> a >> b;
	
	if(a == b)
	{
		cout << 0 << endl;
		return 0;
	}
	
	if(b < a) swap(a, b);
	int ans = 200;
	int c, d;
	for(int i = 0; i <= b; i++)
	{
		c = 2 * i; d = a + b - 2 * i;
		ans = min(ans, abs(c - d));
	}
	cout << ans << endl;
	return 0;
}
0