没有合适的资源?快使用搜索试试~ 我知道了~
2023“钉耙编程”中国大学生算法设计超级联赛(2).pdf
需积分: 5 0 下载量 100 浏览量
2023-07-27
20:59:02
上传
评论
收藏 3.95MB PDF 举报
温馨提示
试读
23页
2023“钉耙编程”中国大学生算法设计超级联赛(2)
资源推荐
资源详情
资源评论
2023“钉耙编程”中国大学生算法设计超级联赛(2)
2023 年 7 月 20 日 12:00 ∼ 17:00
目录
1 Alice Game 3
1.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Binary Number 4
2.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
3 Conuter Strike 5
3.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
3.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
4 Card Game 8
4.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
5 Or 9
5.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
5.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
6 Fencing the cows 10
6.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1
7 foreverlasting and fried-chicken 12
7.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
7.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
8 Hello World 3 Pro Max 14
8.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
8.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
9 String Problem 16
9.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
9.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
10 Klee likes making friends 17
10.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
10.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
10.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
10.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
11 SPY nding NPY 18
11.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
11.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
11.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
11.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
12 Coin 20
12.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
12.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
12.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
12.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
13 Turret 22
13.1 题目描述 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
13.2 输入格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
13.3 输出格式 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
13.4 输入输出样例 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2
1 Alice Game
时间限制:1000ms 空间限制:64MB
1.1 题目描述
Alice and Bob are playing a game.
There are n monsters in the game, and they stand in a line. Alice and Bob take turns. Each turn,
the player can choose one of two actions:
1. Destroy a consecutive monster sequence of size less than or equal to K.
2. Select K consecutive monsters to destroy, and after destroying these K monsters, the sequential
monster sequence in which they were originally located must be divided into two non-empty sequences.
The two remaining sequences will not be considered continuous.
Here is an example of operation 2, if K = 2 and there are four monsters ABCD in the eld. Now
we can destroy monsters BC because they are continuous, and after destroying them we can be left with
monsters AeeD (e means the area is empty). But we cannot destroy the monster AB or CD, because
the remaining two sequences must be non-empty (in fact, if we do this, only one continuous sequence
remains). Similarly, we can’t destroy monsters AC or BD because monsters A and C are not continuous.
When a player cannot operate, he loses. Now, Alice will play the game rst. She wants to know, can
she win at this game?
1.2 输入格式
An integer T indicates that there are T groups of data.
Next T rows. Enter two integers K and n on each line.
Guarantee 1 ≤ T ≤ 10000, 2 ≤ K ≤ 10
7
, 0 ≤ n ≤ 10
9
.
1.3 输出格式
Output total T lines.
If Alice can win, output ”Alice”, otherwise output ”Bob ”.
1.4 输入输出样例
输入样例:
2
2 2
2 3
输出样例:
Alice
Bob
3
2 Binary Number
时间限制:1000ms 空间限制:64MB
2.1
题目描述
Markyyz is learning binary numbers. There is an easy problem in his homework.
You are given a binary number s
1∼n
(s
1
is the highest bit. s
n
is the lowest bit.). You need to do
an operation exactly k times: select an interval [l, r] (1 ≤ l ≤ r ≤ n) arbitrarily and ip s
l
, s
l+1
, ..., s
r
,
in other word, for all i ∈ [l, r], s
i
becomes 1 if s
i
is 0, s
i
becomes 0 if s
i
is 1. What is the biggest result
binary number after the
k
operations.
Markyyz found useless algorithms useless on the problem, so he asked SPY to help. SPY looked down
on the problem but nally got WA (wrong answer). Can you help them to nd the correct solution?
2.2 输入格式
The rst line of the input contains a single integer T (1 ≤ T ≤ 6 × 10
4
), indicating the number of
test cases.
In each test case:
The rst line contains two integers n, k. (1 ≤ n ≤ 10
5
, 0 ≤ k ≤ 10
18
)
The second line contains a binary number s
1∼n
. (s
1
= 1, ∀i ∈ [2, n] : s
i
∈ {0, 1})
It’s guarenteed that in all test cases,
∑
n ≤ 2.5 × 10
6
2.3 输出格式
You need to print a string of length n in one line, representing the biggest binary number after the k
operations.
2.4 输入输出样例
输入样例:
2
8 2
10100101
5 233333333333333333
11101
输出样例:
11111101
11111
4
剩余22页未读,继续阅读
资源评论
小嗷犬
- 粉丝: 2w+
- 资源: 1334
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功