A16331 | Infinite Card Game
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
The first line contains a single integer $t$ ( $1 \le t \le 10^4$ ) — the number of test cases.
The first line of each test case contains an integer $n$ ( $1 \le n \le 3 \cdot 10^5$ ) — the number of cards Monocarp has.
The second line contains $n$ integers $\mathit{ax}_1, \mathit{ax}_2, \dots, \mathit{ax}_n$ ( $1 \le \mathit{ax}_i \le 10^6$ ) — the attack values of Monocarp's cards.
The third line contains $n$ integers $\mathit{ay}_1, \mathit{ay}_2, \dots, \mathit{ay}_n$ ( $1 \le \mathit{ay}_i \le 10^6$ ) — the defence values of Monocarp's cards.
The fourth line contains a single integer $m$ ( $1 \le m \le 3 \cdot 10^5$ ) — the number of cards Bicarp has.
The fifth line contains $m$ integers $\mathit{bx}_1, \mathit{bx}_2, \dots, \mathit{bx}_m$ ( $1 \le \mathit{bx}_j \le 10^6$ ) — the attack values of Bicarp's cards.
The sixth line contains $m$ integers $\mathit{by}_1, \mathit{by}_2, \dots, \mathit{by}_m$ ( $1 \le \mathit{by}_j \le 10^6$ ) — the defence values of Bicarp's cards.
Additional constraints on the input: the sum of $n$ over all test cases doesn't exceed $3 \cdot 10^5$ , the sum of $m$ over all test cases doesn't exceed $3 \cdot 10^5$ .
The first line of each test case contains an integer $n$ ( $1 \le n \le 3 \cdot 10^5$ ) — the number of cards Monocarp has.
The second line contains $n$ integers $\mathit{ax}_1, \mathit{ax}_2, \dots, \mathit{ax}_n$ ( $1 \le \mathit{ax}_i \le 10^6$ ) — the attack values of Monocarp's cards.
The third line contains $n$ integers $\mathit{ay}_1, \mathit{ay}_2, \dots, \mathit{ay}_n$ ( $1 \le \mathit{ay}_i \le 10^6$ ) — the defence values of Monocarp's cards.
The fourth line contains a single integer $m$ ( $1 \le m \le 3 \cdot 10^5$ ) — the number of cards Bicarp has.
The fifth line contains $m$ integers $\mathit{bx}_1, \mathit{bx}_2, \dots, \mathit{bx}_m$ ( $1 \le \mathit{bx}_j \le 10^6$ ) — the attack values of Bicarp's cards.
The sixth line contains $m$ integers $\mathit{by}_1, \mathit{by}_2, \dots, \mathit{by}_m$ ( $1 \le \mathit{by}_j \le 10^6$ ) — the defence values of Bicarp's cards.
Additional constraints on the input: the sum of $n$ over all test cases doesn't exceed $3 \cdot 10^5$ , the sum of $m$ over all test cases doesn't exceed $3 \cdot 10^5$ .
输入格式
For each test case, print three integers:
- the number of Monocarp's starting moves that result in a win for Monocarp;
- the number of Monocarp's starting moves that result in a draw;
- the number of Monocarp's starting moves that result in a win for Bicarp.
- the number of Monocarp's starting moves that result in a win for Monocarp;
- the number of Monocarp's starting moves that result in a draw;
- the number of Monocarp's starting moves that result in a win for Bicarp.
输出格式
无
输入输出样例
输入 #1
3 3 8 7 4 7 1 10 2 8 4 5 10 9 8 8 5 5 5 4 4 1 4 2 7 5 2 8 9 7 1 9 10 9 8 7 6 5 5 4 3 2 1 7 1 6 7 5 8 8 4 9 6 1 10 5 1 10 5
输出 #1
1 1 1 2 4 3 0 1 0
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted