上一页 1 2 3 4 5 6 7 8 9 10 ··· 22 下一页
摘要: 比赛链接 C题 一个二维背包问题 //二维背包 #include <bits/stdc++.h> using namespace std; const int MAXN = 1010; int t[MAXN], a[MAXN], w[MAXN]; int dp[MAXN][MAXN]; int ma 阅读全文
posted @ 2020-10-07 19:39 LightAc 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 注:一日恰饭之余,LL大佬说刷啥线段树不如做些DP题,想想也是==然后刷了几道DP题 https://vjudge.net/contest/399437#overview 后续写了上面contest的题,在这篇随笔继续更新 两道下饭题 思路:数字三角形,最简单的DP,没有之一 #include <b 阅读全文
posted @ 2020-10-06 21:27 LightAc 阅读(205) 评论(0) 推荐(1) 编辑
摘要: 题目链接:http://codeforces.com/contest/1422 A题 签到题 #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll MODE = 1e9 + 7; string s; 阅读全文
posted @ 2020-10-05 10:21 LightAc 阅读(402) 评论(6) 推荐(2) 编辑
摘要: 题目链接:https://vjudge.net/contest/398996 榜单:https://ccpc.io/index.php/a/185.html 获奖名单:https://ccpc.io/index.php/a/191.html A题 差分约束,最短路,会了再写,金牌题 https:// 阅读全文
posted @ 2020-10-04 15:27 LightAc 阅读(497) 评论(0) 推荐(1) 编辑
摘要: A题 #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int n, x; cin >> n >> x; int ans = 0; for(int i = 0; i < 阅读全文
posted @ 2020-09-29 11:02 LightAc 阅读(184) 评论(0) 推荐(0) 编辑
摘要: A题 思路:取出最小值,所有数加到最小值的最大倍数使得不超过k 记录次数即可 #include <bits/stdc++.h> using namespace std; int main () { int T; cin >> T; while(T--) { int n, k; cin >> n >> 阅读全文
posted @ 2020-09-29 11:00 LightAc 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 第一次博客作业 个人简介: 18020032002;我是丁泽中;我的爱好是计算机;来自四川;推荐海大的一道菜:二餐二的麻辣香锅;一句想说的话:欲穷千里目,更上一层楼。 18170023039;我是徐凯新;我的爱好是睡觉;我最喜欢教育超市的泡面;哥 咱家有钱啦。 18020032007;我是蒋四海;我 阅读全文
posted @ 2020-09-27 09:47 LightAc 阅读(329) 评论(0) 推荐(0) 编辑
摘要: A题 容易题。只有严格单调递减情况是NO因为需要n*(n-1)/2次。其余都行 #include <bits/stdc++.h> using namespace std; int main () { int t; cin >> t; while(t--) { int n; cin >> n; vec 阅读全文
posted @ 2020-09-25 11:45 LightAc 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 对二叉树进行中序遍历,用maxCount记录最大值。如果存在count==maxCount,压进vector之中。如果count更大,更新vector。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * 阅读全文
posted @ 2020-09-24 15:44 LightAc 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 比赛链接:http://codeforces.com/contest/1419 A题 题意: 简单博弈论。运用数学知识分析出规律:如果总数是奇数时,最后剩下的一定是位置为奇数位置对应的值。(如果想不明白建议模拟一下过程)在这种情况下,Raze可以选择剩下哪一个,所以如果存在奇数位置存在数为奇数,Ra 阅读全文
posted @ 2020-09-23 21:22 LightAc 阅读(172) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 22 下一页
返回顶端