結果

問題 No.2781 A%B問題
ユーザー Prala
提出日時 2024-08-11 19:38:45
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 218 bytes
コンパイル時間 848 ms
コンパイル使用メモリ 78,284 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-08-11 19:38:47
合計ジャッジ時間 1,404 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

void solve(){
	using namespace std;
	int A, B;
	cin >> A >> B;
	int r = 1e8;
	for (int i = -200; i < 201; i++){
		r = min(r, abs(A-B*i));
	}
	cout << r <<endl;
}

int main(){
	solve();
	return 0;
}
0