結果
問題 |
No.3173 じゃんけんの勝ちの回数
|
ユーザー |
|
提出日時 | 2025-06-06 22:13:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 40 ms / 2,000 ms |
コード長 | 995 bytes |
コンパイル時間 | 3,406 ms |
コンパイル使用メモリ | 275,428 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-06-06 22:14:00 |
合計ジャッジ時間 | 6,225 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h> #define fi first #define se second #define rep(i,s,n) for (int i = (s); i < (n); ++i) #define rrep(i,n,g) for (int i = (n)-1; i >= (g); --i) #define all(a) a.begin(),a.end() #define rall(a) a.rbegin(),a.rend() #define len(x) (int)(x).size() #define dup(x,y) (((x)+(y)-1)/(y)) #define pb push_back #define eb emplace_back #define Field(T) vector<vector<T>> using namespace std; using ll = long long; using ull = unsigned long long; template<typename T> using pq = priority_queue<T,vector<T>,greater<T>>; using P = pair<int,int>; template<class T>bool chmax(T&a,T b){if(a<b){a=b;return 1;}return 0;} template<class T>bool chmin(T&a,T b){if(b<a){a=b;return 1;}return 0;} void solve() { int a, b, c; int d, e, f; cin >> a >> b >> c >> d >> e >> f; int ans1 = max(0, a-d-f) + max(0, b-e-d) + max(0, c-f-e); int ans2 = min(a, e) + min(b, f) + min(c, d); cout << ans1 << " " << ans2 << endl; } int main() { int t; cin >> t; while(t--) solve(); return 0; }