- 博客(30)
- 问答 (1)
- 收藏
- 关注
原创 Educational Codeforces Round 135 (Rated for Div. 2)A-D
Educational Codeforces Round 135 (Rated for Div. 2)
2022-09-10 10:03:47
373
原创 Codeforces Round #819 (Div. 1 + Div. 2) A -D
Codeforces Round #819 (Div. 1 + Div. 2) A -D
2022-09-08 00:07:54
788
原创 Educational Codeforces Round 134 (Rated for Div. 2)A-D
Educational Codeforces Round 134 (Rated for Div. 2)A-D
2022-09-02 12:29:43
147
原创 CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!)
CodeTON Round 2 (Div. 1 + Div. 2, Rated, Prizes!)
2022-08-01 20:41:22
722
1
原创 Codeforces Round #778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round)
Dashboard - Codeforces Round #778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round) -
2022-03-27 21:45:02
266
原创 Educational Codeforces Round 124 (Rated for Div. 2)
Dashboard - Educational Codeforces Round 124 (Rated for Div. 2) - Codeforceshttps://codeforces.com/contest/1651A. Playoff签到题,第一轮以后剩下的都是奇数,奇数又取最大,答案就是2的n次方-1#include<bits/stdc++.h>using namespace std;#define endl '\n' const int maxn = 0;co
2022-03-16 22:43:03
226
原创 Codeforces Round #775 (Div. 2, based on Moscow Open Olympiad in Informatics)
Dashboard - Codeforces Round #775 (Div. 2, based on Moscow Open Olympiad in Informatics) - CodeforcesCodeforces. Programming competitions and contests, programming communityhttps://codeforces.com/contest/1649先放个连接,之前都是打虚拟赛,第一次打实时赛只做出来两题,好菜啊自己A. Game因为只
2022-03-07 23:12:40
437
原创 Codeforces Round #752 (Div. 2)
Dashboard - Codeforces Round #752 (Div. 2) - Codeforces (Unofficial mirror site, accelerated for Chinese users)Codeforces. Programming competitions and contests, programming communityhttps://codeforces.ml/contest/1604放个链接在这里,然后开始小小的复盘A比较简单跳过了,B想了一会,发现与XO
2021-12-13 23:17:38
260
原创 E. Polycarp and String Transformation题解
Problem - E - Codeforces (Unofficial mirror site, accelerated for Chinese users)这道题最后用模拟去调了一下顺序的问题,感觉有点小小的偷鸡,但是能ac就是好代码!首先倒着扫一遍,根据它的出现顺序去判断删除顺序,第一个第一次出现的字母是倒数第一个删除的字母,第二个第一次出现的字母是倒数第二个删除的字母依次类推,然后得到删除顺序(答案的二分之一!)由题意可得,原字符串肯定就在input给的字符串的最前面,只
2021-10-25 22:00:30
216
原创 AutoX安途杯中山大学程序设计校赛E-Sequence I
呜呜,区间dp我不会,全排列也不知道,看了题解小小的复盘一下(copy)//全排列做法#include<bits/stdc++.h>using namespace std;typedef long long ll;#define INF 0x3f3f3f3fint main(){ int t; scanf("%d",&t); while(t--){ int n; int a[9] = {};
2021-10-21 20:31:47
195
原创 Codeforces Round #747 (Div. 2)C. Make Them Equal
Problem - C - Codeforces转完专业以后摸太久了...从今天开始一定要好好做题了(希望)这道题打训练的时候思路是如果最后一个不是就选最后一个,如果是就找一个和pos数组里有问题的数互质的数,队友写完以后发现有规律,在所有数的后半段的任意一个数都和所有在它后面的数都互质,而前面的数由于题目特性都被解决了#include<bits/stdc++.h>using namespace std; int t,n;char ch;string s; i
2021-10-12 17:50:59
150
原创 Codeforces Round #702 (Div. 3) F
Problem - F - Codeforceshttps://codeforces.com/contest/1490/problem/F虚拟比赛差点做出来这题,最后有思路时间不够了,属于绕远路了,一开始就想着找规律而不是去做更朴素的算法#include<bits/stdc++.h>using namespace std ;const int maxn = 2e5+10;long long sum[maxn];vector<int>z;map<int,int
2021-09-16 15:49:40
90
原创 P1439 【模板】最长公共子序列题解
这道题最开始是考虑用类似快排里面哨兵法的感觉#include <bits/stdc++.h>using namespace std;const int maxn = 1e5+10;int fi[maxn],se[maxn],dp[10001][10001];int main(){ int n; scanf("%d",&n); for(int i = 1;i<=n;i++) scanf("%d",&fi[i]);
2021-09-08 18:14:40
692
原创 (移动方向状态标志)P1518 [USACO2.4]两只塔姆沃斯牛 The Tamworth Two题解
这道题分为两部分,一部分在于是否能两个人互相撞上,另一部分在于两个人要走多少步才能撞上。很惭愧,虽然ac了,但是主要原因是数据卡的很松,第一部分是靠判断它的步数如果大于多少则不能撞上这样猜过去的#include<bits/stdc++.h>using namespace std;const int maxn = 1e5+10;int pos[20][20]; //边界外处为0(屏障)long long mx = 1e5; //暴力不在=-=void js(){
2021-08-29 15:18:57
266
原创 2019 CCPC网络赛1001A - ^&^
思维题(打表是个好东西)#include <bits/stdc++.h>using namespace std;int main(){ int t; scanf("%d",&t); while(t--){ long long a,b; scanf("%lld%lld",&a,&b); long long ans = a & b; if(!ans)
2021-08-26 14:59:33
73
原创 P1303 A*B Problem 题解
P1303 A*B Problem - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)做的时候不太懂乘法原理。现在大概了解个大概了乘法原理就是,a的第i位*b的第j位在答案的i+j-1位,可以试着用十进制的思路去理解28*24,两者十位数相乘的时候,相当于20*20,这样一来得到的就是400,位于答案第三位,然后先暂时允许每一位拥有大于10的数,结束以后再遍历进行进位#include<bits/stdc++.h>using namespace std;c
2021-08-26 09:50:03
861
原创 2020ccpc网络赛 CCPC Training Class
Problem - 6894 (hdu.edu.cn)字符苦手=-=,最近老是在字符串上载跟斗,单个字符的输入最好要用cin希望自己记得因为每次都会忘记排除回车=-=,而且每次都会碰见各种各样的bug,输入流输出流的原理不太明白,最好碰见单个字符还是用cin吧这道题不用string的话会妥妥的超时,string自带的size比strlen要快好像解释一下题意:找每句话中出现最多的字母的出现的次数#include<bits/stdc++.h>using namespace
2021-08-25 14:37:23
303
原创 P1002 [NOIP2002 普及组] 过河卒题解
P1002 [NOIP2002 普及组] 过河卒 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)这道题并不需要用拓扑,用正常的dp就可以了,因为移动的方向只有两个,可以用dp的特性保证两个方向都涉及到并且不会导致重复计算马本身也是个陷进点、好坑#include<bits/stdc++.h>using namespace std;const int maxn = 30;long long dp[maxn][maxn];int ju[maxn][maxn];
2021-08-24 11:51:27
168
1
原创 P1802 5倍经验日(01背包变形)
#include<bits/stdc++.h>using namespace std;const int maxn = 1e3+10;int shu[maxn],ying[maxn],w[maxn];long long dp[maxn];int main(){ int n,x; //x是药物数量,n是n个人 scanf("%d%d",&n,&x); for(int i = 1;i<=n;i++) scanf("%d...
2021-08-24 09:48:22
65
原创 P4017 最大食物链计数题解
P4017 最大食物链计数 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)一开始写的时候考虑用的是dfs,从生产者开始入队,然后进行一个搜索,搜到一次最后的就答案+1;#include<bits/stdc++.h>using namespace std;const int maxn = 5e3+2;const int mod = 80112002;int pos[maxn][maxn]; //pos[i][j]意味着i可以吃jint ju[maxn];
2021-08-23 20:04:46
196
原创 P2196 [NOIP1996 提高组] 挖地雷题解
P2196 [NOIP1996 提高组] 挖地雷 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)先放个题目链接,这道题是我第一次做到试着储存dp路径的,不是很难想但是实现花了一段时间,顺带发现了一个小坑,for(t = 1;t<=a;t++),在for循环的后续使用的t=a+1而不是a了#include<bits/stdc++.h>using namespace std;const int maxn = 30;int num[maxn];int po.
2021-08-23 14:29:26
288
原创 P1434 [SHOI2002]滑雪题解
这道题个人是从记忆化搜索起手的,之前没怎么用过,也算是通过这道题区分了一下记忆化搜索(队列和递归)和动态规划之间比较小的区别,心得都写在注释里了////记忆化搜索和动态规划相比,记忆化搜索算是略微复杂的通解,因为动态规划是考虑到for循环中的遍历顺序而创建的转移方程,/// 但是如果for循环无法建立这样的转移方程(for循环只能从左到右或者从右到左,从上到下或者从下到上)////那么只能用较复杂的记忆化搜索,记忆化搜索是不一定能用队列的dfs(因为涉及到队列的时候一般是先高层再底层维护,递归
2021-08-23 10:21:51
194
空空如也
我的char二维数组存了不止一个字符
2021-07-01
TA创建的收藏夹 TA关注的收藏夹
TA关注的人