1. 应该n是偶数,就行吧。应该判断1个人,只能出现一次吧。 1 #include<bits/stdc++.h> 2 #define pb push_back 3 typedef long long ll; 4 using namespace std; 5 typedef pair<int, int ...
分类:
其他好文 时间:
2017-06-01 23:46:15
阅读次数:
458
题目这里 A.map裸题 #include <bits/stdc++.h> using namespace std; map <string, int> p; string s[] = { "Tetrahedron", "Cube", "Octahedron" , "Dodecahedron", " ...
分类:
其他好文 时间:
2017-05-31 16:44:56
阅读次数:
252
【解题思路】 A*(上下界剪枝)。 答案上界:15。 答案下界:当前步数+当前状态剩余步数估价。 这里我们简单地设计估价函数为当前状态与目标状态不相同的棋子数-1,与0的较大值。这样保证了0≤估价≤正确步数。 复杂度o(25*C(24,12))。 【参考程序】 1 #include <bits/st ...
分类:
其他好文 时间:
2017-05-30 20:54:37
阅读次数:
130
题目: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: Example 1: ...
分类:
编程语言 时间:
2017-05-29 22:57:43
阅读次数:
276
由于下午硬钢树套树和大力颓废就没补完 C:我傻逼比赛时没做出来。。。就是排个序然后算贡献 #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 300010, mod = 1000000007 ...
分类:
其他好文 时间:
2017-05-29 20:35:20
阅读次数:
206
题目链接:http://codeforces.com/gym/101147/problem/G 题意:n个人,去参加k个游戏,k个游戏必须非空,有多少种放法? 分析: 第二类斯特林数,划分好k个集合后乘以阶乘; 1 #include <bits/stdc++.h> 2 3 using namespa ...
分类:
其他好文 时间:
2017-05-29 18:15:17
阅读次数:
214
A:暴力模拟 #include<bits/stdc++.h> using namespace std; int a, b; int main() { scanf("%d%d", &a, &b); int delta = 1, x = 0; while(1) { if(x == 0) { if(a < ...
分类:
其他好文 时间:
2017-05-29 12:06:06
阅读次数:
234
1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 struct Node { 5 int next[10]; 6 int num; 7 } node[100005]; 8 int len = 0; ...
分类:
其他好文 时间:
2017-05-28 22:24:17
阅读次数:
211
autumn#include<bits/stdc++.h> using namespace std; const int maxn = 200005; int p[maxn],a[maxn],b[maxn]; bool vis[maxn]; set<pair<int,int> >s[5]; int ...
分类:
其他好文 时间:
2017-05-28 16:50:44
阅读次数:
225
方法一: DFS 方法二:生成函数 每个数可以重复一定次数,求排列组合数,这是裸的指数型生成函数; 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 double c1[15],c2[15]; 6 int a[15]; 7 int num ...
分类:
其他好文 时间:
2017-05-28 12:25:55
阅读次数:
153