摘要:
Bellman-Ford 基于迭代思想的暴力,而非贪心 // 853.有边数限制的最短路 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 510; const 阅读全文
摘要:
A. 搬家 stack #include <iostream> #include <algorithm> #include <cstring> #include <string> #include <stack> using namespace std; int n; stack<string> s 阅读全文
摘要:
第一题 7-1 Arithmetic Progression of Primes (20 分) 未加优化 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 10 阅读全文
摘要:
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 阅读全文
摘要:
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[ 阅读全文
摘要:
A New Year and Counting Cards 题目链接: http://codeforces.com/contest/908/problem/A 思路: 如果卡片上面是数字,如果是奇数,就需要检查一下。如果是字母,如果是原音字母,需要检查一下。 代码: #include <bits/s 阅读全文
摘要:
Educational Codeforces Round 35 (Rated for Div. 2) A Nearest Minimums 题目链接: http://codeforces.com/contest/911/problem/A 思路: 找出最小值之间的最小差距即可 代码: #includ 阅读全文
摘要:
Codeforces Round 452 (Div. 2) A Splitting in Teams 题目链接: [http://codeforces.com/contest/899/problem/A][2ef9cdcd] 思路: 统计1和2出现的次数,尽量使2能够与1匹配尽可能多用。假设1再匹配 阅读全文
摘要:
Codeforces Round 451 (Div. 2) A Rounding 题目链接: [http://codeforces.com/contest/898/problem/A][815db73d] 思路: 小于等于5向下,大于补上差值输出 代码: c++ include using name 阅读全文
摘要:
Educational Codeforces Round 34 (Rated for Div. 2) A Hungry Student Problem 题目链接: [http://codeforces.com/contest/903/problem/A][abbccaf2] 思路: 直接模拟 代码: 阅读全文