結果
問題 | No.2239 Friday |
ユーザー |
![]() |
提出日時 | 2023-03-10 22:21:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 642 bytes |
コンパイル時間 | 3,563 ms |
コンパイル使用メモリ | 251,108 KB |
最終ジャッジ日時 | 2025-02-11 08:34:52 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> #define elif else if #define ll long long #define vll vector<long long> #define vec vector #define embk emplace_back #define rep(i, n) for (int i = 0; i < n; i++) #define rep3(i, n, k) for (int i = k; i < n; i++) #define all(a) a.begin(), a.end() using namespace std; using namespace atcoder; const ll INF = 1LL << 60; const ll mod = 998244353; int main() { ll a, b; cin >> a >> b; if (a > b) swap(a, b); if (a*3 > b) { ll ans = (b-a) % 4; if (a % 2 == 1) ans = (ans+2) % 4; if (ans == 3) ans = 1; cout << ans << endl; } else cout << abs(b - 3*a) << endl; }