上一页 1 2 3 4 5 6 7 ··· 29 下一页
摘要: Bellman-Ford 基于迭代思想的暴力,而非贪心 // 853.有边数限制的最短路 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 510; const 阅读全文
posted @ 2021-03-27 17:22 lemonsbiscuit 阅读(57) 评论(0) 推荐(0) 编辑
摘要: A. 搬家 stack #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <stack> using namespace std; int n; stack<string> s 阅读全文
posted @ 2021-03-17 17:06 lemonsbiscuit 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 第一题 7-1 Arithmetic Progression of Primes (20 分) 未加优化 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 10 阅读全文
posted @ 2021-03-16 22:41 lemonsbiscuit 阅读(192) 评论(2) 推荐(1) 编辑
摘要: 7-1 Forever (20 分) #include <bits/stdc++.h> using namespace std; int N,K,m,number[10]; multimap<int,int> mp; int sum_digit(int num) { int sum=0; while 阅读全文
posted @ 2019-09-12 01:18 lemonsbiscuit 阅读(1007) 评论(2) 推荐(0) 编辑
摘要: KMP模板 [题目链接:][48ab497a] c++ include include using namespace std; int kmp(string t, string p) { int ans=0; int plen=p.length(); int next[plen],nextval[ 阅读全文
posted @ 2018-03-10 02:58 lemonsbiscuit 阅读(337) 评论(0) 推荐(0) 编辑
摘要: A New Year and Counting Cards 题目链接: http://codeforces.com/contest/908/problem/A 思路: 如果卡片上面是数字,如果是奇数,就需要检查一下。如果是字母,如果是原音字母,需要检查一下。 代码: #include <bits/s 阅读全文
posted @ 2018-01-04 11:58 lemonsbiscuit 阅读(379) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 35 (Rated for Div. 2) A Nearest Minimums 题目链接: http://codeforces.com/contest/911/problem/A 思路: 找出最小值之间的最小差距即可 代码: #includ 阅读全文
posted @ 2017-12-31 21:23 lemonsbiscuit 阅读(313) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round 452 (Div. 2) A Splitting in Teams 题目链接: [http://codeforces.com/contest/899/problem/A][2ef9cdcd] 思路: 统计1和2出现的次数,尽量使2能够与1匹配尽可能多用。假设1再匹配 阅读全文
posted @ 2017-12-17 21:18 lemonsbiscuit 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Codeforces Round 451 (Div. 2) A Rounding 题目链接: [http://codeforces.com/contest/898/problem/A][815db73d] 思路: 小于等于5向下,大于补上差值输出 代码: c++ include using name 阅读全文
posted @ 2017-12-17 12:48 lemonsbiscuit 阅读(412) 评论(0) 推荐(0) 编辑
摘要: Educational Codeforces Round 34 (Rated for Div. 2) A Hungry Student Problem 题目链接: [http://codeforces.com/contest/903/problem/A][abbccaf2] 思路: 直接模拟 代码: 阅读全文
posted @ 2017-12-17 12:02 lemonsbiscuit 阅读(330) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 29 下一页