結果
問題 | No.2239 Friday |
ユーザー |
|
提出日時 | 2023-03-10 21:33:11 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 368 bytes |
コンパイル時間 | 1,835 ms |
コンパイル使用メモリ | 192,152 KB |
最終ジャッジ日時 | 2025-02-11 07:49:25 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/mincostflow> using namespace std; using ll = long long; #define rep(i,n) for(int i=0;i<int(n);i++) int main(){ int a,b; cin>>a>>b; if(a<b) swap(a,b); int ans=1e9; for(int x=0;x<=b;x++){ int y=b-x; int z=a-x; int w=b-y; if(z<0||y<0) continue; ans=min(ans,abs(y+z-x-w)); } cout<<ans<<endl; }