結果

問題 No.3173 じゃんけんの勝ちの回数
ユーザー MaLsI_rAmO
提出日時 2025-06-13 18:55:34
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 1,452 bytes
コンパイル時間 2,063 ms
コンパイル使用メモリ 217,788 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-13 18:55:39
合計ジャッジ時間 3,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

#define int int64_t

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define pi pair<int, int>
#define vi vector<int>
#define pb push_back
#define all(x) (x).begin(), (x).end()

template <typename T>
istream &operator>>(istream &in, vector<T> &v)
{
    for (auto &x : v)
        in >> x;
    return in;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v)
{
    for (const auto &x : v)
        out << x << ' ';
    return out;
}

template <typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p)
{
    in >> p.first >> p.second;
    return in;
}

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p)
{
    out << p.first << ' ' << p.second;
    return out;
}

const int MOD = 1000000007;

void solve()
{
    vi a(3), b(3); cin >> a >> b;
    int max_win = min(a[0], b[1]) + min(a[1], b[2]) + min(a[2], b[0]);
    int min_win = max(0L, a[0] - b[0] - b[2]) + max(0L, a[1] - b[1] - b[0]) + max(0L, a[2] - b[2] - b[1]);
    cout << min_win << " " << max_win << '\n';
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t = 1;
    cin >> t;

    while (t--)
        solve();

    return 0;
}
0