結果
問題 | No.2819 Binary Binary-Operator |
ユーザー | みうね |
提出日時 | 2024-07-26 23:00:35 |
言語 | C++23(gcc13) (gcc 13.2.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 28 ms / 2,000 ms |
コード長 | 7,467 bytes |
コンパイル時間 | 7,130 ms |
コンパイル使用メモリ | 296,408 KB |
実行使用メモリ | 25,836 KB |
平均クエリ数 | 3.00 |
最終ジャッジ日時 | 2024-07-26 23:00:48 |
合計ジャッジ時間 | 11,478 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 28 ms
24,812 KB |
testcase_01 | AC | 24 ms
24,940 KB |
testcase_02 | AC | 25 ms
25,196 KB |
testcase_03 | AC | 24 ms
25,196 KB |
testcase_04 | AC | 24 ms
24,812 KB |
testcase_05 | AC | 23 ms
25,196 KB |
testcase_06 | AC | 24 ms
25,196 KB |
testcase_07 | AC | 24 ms
25,196 KB |
testcase_08 | AC | 23 ms
25,452 KB |
testcase_09 | AC | 24 ms
24,812 KB |
testcase_10 | AC | 24 ms
25,448 KB |
testcase_11 | AC | 23 ms
24,812 KB |
testcase_12 | AC | 24 ms
24,812 KB |
testcase_13 | AC | 24 ms
25,324 KB |
testcase_14 | AC | 24 ms
25,196 KB |
testcase_15 | AC | 24 ms
25,196 KB |
testcase_16 | AC | 24 ms
24,812 KB |
testcase_17 | AC | 24 ms
24,544 KB |
testcase_18 | AC | 23 ms
25,196 KB |
testcase_19 | AC | 24 ms
24,940 KB |
testcase_20 | AC | 24 ms
24,940 KB |
testcase_21 | AC | 23 ms
24,812 KB |
testcase_22 | AC | 24 ms
25,448 KB |
testcase_23 | AC | 23 ms
24,556 KB |
testcase_24 | AC | 23 ms
24,556 KB |
testcase_25 | AC | 23 ms
24,940 KB |
testcase_26 | AC | 23 ms
24,556 KB |
testcase_27 | AC | 23 ms
24,556 KB |
testcase_28 | AC | 24 ms
25,196 KB |
testcase_29 | AC | 24 ms
25,196 KB |
testcase_30 | AC | 24 ms
25,196 KB |
testcase_31 | AC | 24 ms
24,812 KB |
testcase_32 | AC | 24 ms
25,196 KB |
testcase_33 | AC | 24 ms
25,836 KB |
testcase_34 | AC | 24 ms
25,196 KB |
testcase_35 | AC | 24 ms
24,940 KB |
testcase_36 | AC | 24 ms
24,940 KB |
testcase_37 | AC | 23 ms
24,812 KB |
testcase_38 | AC | 23 ms
25,196 KB |
testcase_39 | AC | 24 ms
25,520 KB |
testcase_40 | AC | 23 ms
25,196 KB |
testcase_41 | AC | 24 ms
25,452 KB |
testcase_42 | AC | 23 ms
25,196 KB |
testcase_43 | AC | 24 ms
24,812 KB |
testcase_44 | AC | 24 ms
25,452 KB |
testcase_45 | AC | 23 ms
24,812 KB |
testcase_46 | AC | 24 ms
25,324 KB |
testcase_47 | AC | 24 ms
24,812 KB |
testcase_48 | AC | 25 ms
24,812 KB |
testcase_49 | AC | 24 ms
24,812 KB |
testcase_50 | AC | 24 ms
24,940 KB |
testcase_51 | AC | 24 ms
25,324 KB |
testcase_52 | AC | 25 ms
24,940 KB |
testcase_53 | AC | 25 ms
25,196 KB |
testcase_54 | AC | 23 ms
25,196 KB |
testcase_55 | AC | 24 ms
24,812 KB |
testcase_56 | AC | 24 ms
25,196 KB |
testcase_57 | AC | 24 ms
25,196 KB |
testcase_58 | AC | 24 ms
25,196 KB |
testcase_59 | AC | 23 ms
24,940 KB |
testcase_60 | AC | 24 ms
24,940 KB |
testcase_61 | AC | 24 ms
24,556 KB |
testcase_62 | AC | 23 ms
25,452 KB |
testcase_63 | AC | 23 ms
25,196 KB |
ソースコード
#ifdef LOCAL #define _GLIBCXX_DEBUG #else #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #endif #include <bits/stdc++.h> // #include <bits/extc++.h> using namespace std; // #include <atcoder/all> // using namespace atcoder; // using mint = modint998244353; using ll = long long; using u32 = unsigned int; using u64 = unsigned long long; using i128 = __int128; using u128 = unsigned __int128; using f128 = __float128; template <class T> constexpr T infty = 0; template <> constexpr int infty<int> = 1'000'000'000; template <> constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2; template <> constexpr u32 infty<u32> = infty<int>; template <> constexpr u64 infty<u64> = infty<ll>; template <> constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>; template <> constexpr double infty<double> = infty<ll>; template <> constexpr long double infty<long double> = infty<ll>; using pi = pair<int, int>; using pl = pair<ll, ll>; using vi = vector<int>; using vl = vector<ll>; template <class T> using vc = vector<T>; template <class T> using vvc = vector<vc<T>>; using vvi = vvc<int>; using vvl = vvc<ll>; template <class T> using vvvc = vector<vvc<T>>; template <class T> using vvvvc = vector<vvvc<T>>; template <class T> using vvvvvc = vector<vvvvc<T>>; template <class T> using pq = std::priority_queue<T>; template <class T> using pqg = std::priority_queue<T, vector<T>, greater<T>>; // template <typename K> // using tree = __gnu_pbds::tree<K, __gnu_pbds::null_type, std::less<>, // __gnu_pbds::rb_tree_tag, // __gnu_pbds::tree_order_statistics_node_update>; #define vv(type, name, h, ...) \ vector<vector<type>> name(h, vector<type>(__VA_ARGS__)) #define vvv(type, name, h, w, ...) \ vector<vector<vector<type>>> name( \ h, vector<vector<type>>(w, vector<type>(__VA_ARGS__))) #define vvvv(type, name, a, b, c, ...) \ vector<vector<vector<vector<type>>>> name( \ a, vector<vector<vector<type>>>( \ b, vector<vector<type>>(c, vector<type>(__VA_ARGS__)))) #define FOR1(a) for (ll _ = 0; _ < (ll)a; ++_) #define FOR2(i, a) for (ll i = 0; i < (ll)a; ++i) #define FOR3(i, a, b) for (ll i = a; i < (ll)b; ++i) #define FOR4(i, a, b, c) for (ll i = a; i < (ll)b; i += (c)) #define FOR1_R(a) for (ll i = (a) - 1; i >= 0; --i) #define FOR2_R(i, a) for (ll i = (a) - 1; i >= 0; --i) #define FOR3_R(i, a, b) for (ll i = (b) - 1; i >= (ll)a; --i) #define overload4(a, b, c, d, e, ...) e #define overload3(a, b, c, d, ...) d #define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__) #define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__) #define FOR_subset(t, s) \ for (int t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s))) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() int popcnt(int x) { return __builtin_popcount(x); } int popcnt(u32 x) { return __builtin_popcount(x); } int popcnt(ll x) { return __builtin_popcountll(x); } int popcnt(u64 x) { return __builtin_popcountll(x); } int popcnt_mod_2(int x) { return __builtin_parity(x); } int popcnt_mod_2(u32 x) { return __builtin_parity(x); } int popcnt_mod_2(ll x) { return __builtin_parityll(x); } int popcnt_mod_2(u64 x) { return __builtin_parityll(x); } // (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2) int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); } int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); } int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); } // (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2) int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); } int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); } int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); } template <typename T> T floor(T a, T b) { return a / b - (a % b && (a ^ b) < 0); } template <typename T> T ceil(T x, T y) { return floor(x + y - 1, y); } template <typename T> T bmod(T x, T y) { return x - y * floor(x, y); } template <typename T> pair<T, T> divmod(T x, T y) { T q = floor(x, y); return {q, x - q * y}; } template <typename T, typename U> T POW(U x_, int n) { T x = x_; T ret = 1; while (n > 0) { if (n & 1) ret *= x; x *= x; n >>= 1; } return ret; } template <typename T, typename U> T SUM(const vector<U> &A) { T sm = 0; for (auto &&a : A) sm += a; return sm; } #define MIN(v) *min_element(all(v)) #define MAX(v) *max_element(all(v)) #define LB(c, x) distance((c).begin(), lower_bound(all(c), (x))) #define UB(c, x) distance((c).begin(), upper_bound(all(c), (x))) #define UNIQUE(x) \ sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit() template <class T, class S> inline bool chmax(T &a, const S &b) { return (a < b ? a = b, 1 : 0); } template <class T, class S> inline bool chmin(T &a, const S &b) { return (a > b ? a = b, 1 : 0); } // ? は -1 vc<int> s_to_vi(const string &S, char first_char) { vc<int> A(S.size()); FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); } return A; } template <typename T, typename U> vector<T> cumsum(vector<U> &A, int off = 1) { int N = A.size(); vector<T> B(N + 1); FOR(i, N) { B[i + 1] = B[i] + A[i]; } if (off == 0) B.erase(B.begin()); return B; } // stable sort template <typename T> vector<int> argsort(const vector<T> &A) { vector<int> ids(A.size()); iota(all(ids), 0); sort(all(ids), [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); }); return ids; } // A[I[0]], A[I[1]], ... template <typename T> vc<T> rearrange(const vc<T> &A, const vc<int> &I) { vc<T> B(I.size()); FOR(i, I.size()) B[i] = A[I[i]]; return B; } void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; } void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; } #ifdef LOCAL // https://zenn.dev/sassan/articles/19db660e4da0a4 #include "/Library/cpp-dump/dump.hpp" #define dump(...) cpp_dump(__VA_ARGS__) #else #define dump(...) #define CPP_DUMP_SET_OPTION(...) #define CPP_DUMP_DEFINE_EXPORT_OBJECT(...) #define CPP_DUMP_DEFINE_EXPORT_ENUM(...) #define CPP_DUMP_DEFINE_DANGEROUS_EXPORT_OBJECT(...) #endif //---------------------------------------------------------------- void solve() { int X, Y; cin >> X >> Y; if (X == 0 && Y == 0) { cout << 4 << endl; cout << "0 0 0 0" << endl; int t; cin >> t; cout << t << endl; return; } if (X == 1 && Y == 1) { cout << 4 << endl; cout << "1 1 1 1" << endl; int t; cin >> t; cout << t << endl; return; } if (X == 0) { cout << 4 << endl; cout << "0 1 1 1" << endl; int t; cin >> t; cout << t << endl; return; } if (Y == 0) { cout << 4 << endl; cout << "1 0 0 0" << endl; int t; cin >> t; cout << t << endl; return; } } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(20); CPP_DUMP_SET_OPTION(max_line_width, 80); CPP_DUMP_SET_OPTION(log_label_func, cpp_dump::log_label::filename()); CPP_DUMP_SET_OPTION(enable_asterisk, true); solve(); return 0; }