摘要: ## [B. Swap and Reverse](https://codeforces.com/contest/1864/problem/B) 这道题需要进行分类讨论 - 当$k$为奇数时,字符串上的奇数位和偶数位无法进行交换,所以求字典最小序只需要把奇偶位分开进行排序 - 当$k$为偶数时,字符串 阅读全文
posted @ 2023-09-08 14:57 铜锣骚 阅读(24) 评论(0) 推荐(0)
摘要: ## [E. Data Structures Fan](https://codeforces.com/contest/1872/problem/E) 这道题可以先对数组$a$进行异或前缀和操作,得到数组$b$,并在初始情况下记录下所有$s[i]$为0/1的异或和为$x0$,$x1$,之后处理询问操作 阅读全文
posted @ 2023-09-08 13:05 铜锣骚 阅读(38) 评论(0) 推荐(0)
摘要: ## [D. Plus Minus Permutation](https://codeforces.com/contest/1872/problem/D) 这道题要使$(p_{1 \cdot x} + p_{2 \cdot x} + \ldots + p_{\lfloor \frac{n}{x} \ 阅读全文
posted @ 2023-09-08 12:47 铜锣骚 阅读(32) 评论(0) 推荐(0)
摘要: ## [C. Non-coprime Split](https://codeforces.com/contest/1872/problem/C) 这道题可以先进行分类讨论。 - 当$r #define endl '\n' using namespace std; typedef long long 阅读全文
posted @ 2023-09-08 12:29 铜锣骚 阅读(46) 评论(0) 推荐(0)
摘要: ## [B. The Corridor or There and Back Again](https://codeforces.com/contest/1872/problem/B) 由题意可知,对于每一个***d~i~***和***s~i~***,必须要在进入房间***d~i~***的***s~i 阅读全文
posted @ 2023-09-08 09:31 铜锣骚 阅读(25) 评论(0) 推荐(0)
摘要: ## [A. Two Vessels](https://codeforces.com/contest/1872/problem/A) 简单题。先计算杯子a和杯子b里水的差值,在计算需要用c杯子舀几次水就行 $$Ans=ceil(|a-b|/2c)$$ #### 代码 ```cpp #include 阅读全文
posted @ 2023-09-08 09:16 铜锣骚 阅读(42) 评论(0) 推荐(0)