Loading

随笔分类 -  ACM

摘要:A.最大下降矩阵 题目: 我们称一个矩阵是下降矩阵,当且仅当,矩阵的每一列都是严格下降的。很显然,这个要求很苛刻,大多数矩阵都无法满足。但是显然如果消去一些行,一定可以使得这个矩阵变成下降矩阵。 现在给出一个n行m列的矩阵,请你求出最少消去多少行,可以使得这个矩阵变为下降矩阵。 思路: 直接按照求最 阅读全文
posted @ 2020-11-24 02:52 WinterFa1L 阅读(431) 评论(0) 推荐(0)
摘要:A hello world 签到 #include<bits/stdc++.h> using namespace std; string s="hello world"; int main(){ for(int i=0;i<s.size();i++){ cout<<char(s[i]+1); } } 阅读全文
posted @ 2020-11-24 01:51 WinterFa1L 阅读(317) 评论(0) 推荐(0)
摘要:A. Buy the String 大意: 给定一个01字符串,$c_0$代表购买一个字符0的花费,$c_1$代表购买一个字符1的消费,h代表0和1转换的花费,问购买整个字符串花费最小值 思路: 贪心比较直接购买和转换的价格即可 #include<bits/stdc++.h> using names 阅读全文
posted @ 2020-11-23 15:13 WinterFa1L 阅读(121) 评论(0) 推荐(0)
摘要:A. Kids Seating 大意: 输入n,需要输出n个$1-4*n$之间的数,满足任意两个数不互素且不互相整除 思路: 直接输出$2n+2,2n+4.....4*n$即可 #include<bits/stdc++.h> using namespace std; const int N = 1e 阅读全文
posted @ 2020-11-19 21:39 WinterFa1L 阅读(116) 评论(0) 推荐(0)
摘要:A. Add Candies 大意: 给出一个数$n$,代表有$n$个堆糖果且$a_i=i$代表每堆糖果数量,每次可以选择一堆糖果,使得除了这堆糖果以外的每一堆糖果数量都加上这堆糖果的数量,问怎样操作可以最终使得每堆糖果数量相同 思路: 构造题,每次都选第$i$堆即可,这样最后每一堆糖果的数量都是$ 阅读全文
posted @ 2020-11-19 02:43 WinterFa1L 阅读(153) 评论(0) 推荐(0)
摘要:写在前面 最近开始刷CF,今天第一次补完完整的一套CF,总结一下吧,发现做过的题不赶紧总结写题解就容易忘了。 立个flag 争取每天更新一篇CF题解 A. Boring Apartments 模拟题,模拟就完了 #include<bits/stdc++.h> using namespace std; 阅读全文
posted @ 2020-11-18 09:02 WinterFa1L 阅读(129) 评论(0) 推荐(0)
摘要:PREV-1 核桃的数量 #include<bits/stdc++.h> using namespace std; int main() { int a,b,c,d; cin>>a>>b>>c; d=(a*b/__gcd(a,b)); cout<<c*d/__gcd(d,c); } PREV-2 打 阅读全文
posted @ 2020-10-15 01:28 WinterFa1L 阅读(136) 评论(0) 推荐(0)
摘要:题目链接: https://nanti.jisuanke.com/t/44460 有向无环图,求点1到位置大于L的点的路径数 #include<bits/stdc++.h> using namespace std; vector<int>mp[2005]; queue<int>q; int anss 阅读全文
posted @ 2020-04-09 08:55 WinterFa1L 阅读(271) 评论(0) 推荐(0)
摘要:连连看 Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 50473 Accepted Submission(s): 12725 Problem 阅读全文
posted @ 2020-04-08 16:24 WinterFa1L 阅读(230) 评论(0) 推荐(0)
摘要:Eight Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 41040 Accepted: 16901 Special Judge Description The 15-puzzle has been around for ove 阅读全文
posted @ 2020-04-07 19:27 WinterFa1L 阅读(184) 评论(0) 推荐(0)
摘要:Friend Chains Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7112 Accepted Submission(s): 2304 P 阅读全文
posted @ 2020-04-05 16:19 WinterFa1L 阅读(353) 评论(0) 推荐(0)
摘要:dfs,对于每个点数的牌,都有:不出、作为同花出、作为顺子出这三种选择 #include<bits/stdc++.h> using namespace std; int a[20],x,anss=0x3f3f3f3f; void dfs(int k) { if(k>13) { int sum=0; 阅读全文
posted @ 2020-04-04 11:03 WinterFa1L 阅读(265) 评论(0) 推荐(0)
摘要:Asteroids! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7089 Accepted Submission(s): 4386 Prob 阅读全文
posted @ 2020-04-03 17:14 WinterFa1L 阅读(8727) 评论(0) 推荐(0)
摘要:We all know that you can’t put a round peg in a square hole. Asking you to do so in this contestwould be cruel and unusual punishment, which is banned 阅读全文
posted @ 2020-03-26 16:25 WinterFa1L 阅读(520) 评论(0) 推荐(0)
摘要:问题描述 蒜头君酷爱搭积木,他用积木搭了 n 辆重量为 wi的小车和一艘最大载重量为 W 的小船,他想用这艘小船将 n 辆小车运输过河。每次小船运载的小车重量不能超过 W。另外,小船在运载小车时,每辆小车会对小船有一个损坏值si,当多辆小车一起运载时,该趟运载对小船的损坏值为船上所有小车的最大损坏值 阅读全文
posted @ 2019-11-19 21:35 WinterFa1L 阅读(262) 评论(0) 推荐(0)
摘要:这一部分内容比较简单 直接把代码发上来 不想自己写的同学可以直接抱走~ 练习题:a+b 问题 练习题:斐波那契数列 练习题:矩阵旋转 练习题:最大子阵 练习题:四平方和 练习题:A+B 问题 练习题:A*B 问题 练习题:蒜头君的随机数 练习题:交叉排序 练习题:进制转换 练习题:回文数 练习题:机 阅读全文
posted @ 2019-09-24 00:40 WinterFa1L 阅读(381) 评论(0) 推荐(0)
摘要:题库链接: https://nanti.jisuanke.com/t/41387 题目大意 给定n个数,与一个数m,求ai右边最后一个至少比ai大m的数与这个数之间有多少个数 思路 对于每一个数,利用二分的方法求他右边大于等于ai+m的数的最后一个值。 关键在于怎么二分呢? 利用线段树存储区间最大值 阅读全文
posted @ 2019-09-08 00:03 WinterFa1L 阅读(331) 评论(0) 推荐(0)
摘要:钱币兑换问题 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 15134 Accepted Submission(s): 9117 Problem 阅读全文
posted @ 2019-08-31 00:34 WinterFa1L 阅读(477) 评论(0) 推荐(0)
摘要:Tickets Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 12331 Accepted Submission(s): 6096 Proble 阅读全文
posted @ 2019-08-31 00:18 WinterFa1L 阅读(211) 评论(0) 推荐(0)
摘要:最大连续子序列 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 43843 Accepted Submission(s): 20002 Probl 阅读全文
posted @ 2019-08-30 00:53 WinterFa1L 阅读(330) 评论(0) 推荐(0)