結果
| 問題 | No.3173 じゃんけんの勝ちの回数 |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2025-06-07 17:35:27 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 2,000 ms |
| + 349µs | |
| コード長 | 692 bytes |
| 記録 | |
| コンパイル時間 | 157 ms |
| コンパイル使用メモリ | 52,396 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-11 06:47:31 |
| 合計ジャッジ時間 | 2,341 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 33 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3173.cc: No.3173 縺倥c繧薙¢繧薙・蜍昴■縺ョ蝗樊焚 - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int K = 3;
/* typedef */
/* global variables */
int as[K], bs[K];
/* subroutines */
/* main */
int main() {
int tn;
scanf("%d", &tn);
while (tn--) {
for (int i = 0; i < K; i++) scanf("%d", as + i);
for (int i = 0; i < K; i++) scanf("%d", bs + i);
int mins = 0, maxs = 0;
for (int i = 0; i < K; i++) {
mins += max(0, as[i] - (bs[i] + bs[(i + 2) % K]));
maxs += min(as[i], bs[(i + 1) % K]);
}
printf("%d %d\n", mins, maxs);
}
return 0;
}
tnakao0123