04 2023 档案
摘要:题意:给定一个k,问由012356789组成的数字第k大的是多少 链接:Problem - E - Codeforces #include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" /* 思
阅读全文
摘要:题意: 给定一个k,可以任意次交换满足 | i - j | = k 或 | i - j |=k+1 的两个位置的元素 很容易发现有区间内的字符是可以任意交换的,但是一个个字符考虑太混乱了(就是这样子把脑袋搞晕了),从左考虑那么(1,n - k)这个区间可以任意交换,从右考虑(k + 1, n)这个区
阅读全文
摘要:题意: 给定一个字符串,删除其中连续两个字符,问有多少种不同字符串的情况 #include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" //开始时假设每个点都对答案有贡献,考虑什么时候没有贡献
阅读全文
摘要:Codeforces Round 860 Div. 2 Three Sevens 题意: 一共m天,每天都会有人买彩票,第i天买了彩票的人,在之后就不会再买彩票了,求一个买票顺序 思路: (第i天买了彩票的人,在之后就不会再买彩票了)所以反向思考,从最后一天开始模拟,如果顺序存在,那么最后一天的所有
阅读全文
摘要:题目链接:Problem - C - Codeforces #include<bits/stdc++.h> using namespace std; typedef long long ll; #define endl "\n" int main() { ios::sync_with_stdio(f
阅读全文