結果
問題 | No.2790 Athena 3 |
ユーザー |
![]() |
提出日時 | 2024-06-23 00:41:12 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,182 bytes |
コンパイル時間 | 2,381 ms |
コンパイル使用メモリ | 244,012 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-23 00:41:15 |
合計ジャッジ時間 | 3,005 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
#include <bits/stdc++.h>using namespace std;#ifdef LOCAL#include "settings/debug.cpp"#define _GLIBCXX_DEBUG#else#define Debug(...) void(0)#endif#define rep(i, n) for (int i = 0; i < (n); ++i)using ll = long long;using ull = unsigned long long;int main() {int _a, _b, _c, _d, _e, _f;cin >> _a >> _b >> _c >> _d >> _e >> _f;int ans = 0;rep(bit, 0b1111'1111'1111 + 1) {int xbit = (bit >> 0) & 0b1111;int ybit = (bit >> 4) & 0b1111;int zbit = (bit >> 8) & 0b1111;if (popcount(ull(xbit)) != 1 || popcount(ull(ybit)) != 1 || popcount(ull(zbit)) != 1) continue;int a = _a + (xbit & 0b0010 ? 1 : 0) - (xbit & 0b0001 ? 1 : 0);int b = _b + (xbit & 0b1000 ? 1 : 0) - (xbit & 0b0100 ? 1 : 0);int c = _c + (ybit & 0b0010 ? 1 : 0) - (ybit & 0b0001 ? 1 : 0);int d = _d + (ybit & 0b1000 ? 1 : 0) - (ybit & 0b0100 ? 1 : 0);int e = _e + (zbit & 0b0010 ? 1 : 0) - (zbit & 0b0001 ? 1 : 0);int f = _f + (zbit & 0b1000 ? 1 : 0) - (zbit & 0b0100 ? 1 : 0);int s = b * c + d * e + a * f - f * c - a * d - b * e;ans = max(ans, abs(s));}cout << ans / 2;if (ans % 2) cout << ".5";cout << endl;return 0;}