結果
問題 | No.2239 Friday |
ユーザー |
![]() |
提出日時 | 2023-03-10 21:36:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 323 bytes |
コンパイル時間 | 1,652 ms |
コンパイル使用メモリ | 167,428 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-18 03:49:28 |
合計ジャッジ時間 | 1,911 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int a, b; cin >> a >> b; if(a == b) { cout << 0 << endl; return 0; } if(a < b) 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; }