結果
| 問題 |
No.2239 Friday
|
| ユーザー |
|
| 提出日時 | 2023-03-11 10:07:59 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 480 bytes |
| コンパイル時間 | 2,089 ms |
| コンパイル使用メモリ | 191,680 KB |
| 最終ジャッジ日時 | 2025-02-11 09:52:32 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void solve(){
int a, b;
cin >> a >> b;
int same = 2*(min(a, b));
int diff = abs(b- a);
if(same <= diff){
cout << diff-same << "\n";
}else{
int ans = (same - diff)%4;
cout << min(4 - ans, ans) << "\n";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
// int t;
// cin >> t;
// while(t--){
// solve();
// }
solve();
return 0;
}