DescriptionAfter winning gold and silver in IOI 2014, Akshat and Malvika want to have some fun. Now they are playing a game on a grid made ofnhorizont...
分类:
其他好文 时间:
2014-07-27 22:17:59
阅读次数:
309
Problem A Codeforces 451A?题意:给你n+m根筷子,将他们分别水平、垂直放置,形成n*m个节点。两个人轮流选择一个点,将穿过这个点的两根筷子拿走,谁可以逼迫对方率先无法继续操作,谁就获胜,问获胜的是先手还是后手。?找规律即可。n,m中较小的那个数是奇数,先手胜,否则后手胜。1...
分类:
其他好文 时间:
2014-07-27 21:53:40
阅读次数:
362
#include
using namespace std;
int a[100020];
int main()
{
int n,t;
scanf("%d%d",&n,&t);
int sum=0,k=1,Max=0;
for(int i=1;i<=n;i++)
{
scanf("%d",&a[i]);
sum+=a[i];...
分类:
其他好文 时间:
2014-07-27 11:45:43
阅读次数:
244
题目:Codeforces Round #258 (Div. 2)Devu and Flowers
题意:n个boxes ,第i个box有fi个flowers,每个boxes中的flowers完全相同,不同boxes的flowers不同,求从n个boxes中取出s个flowers的方案数。n
排列组合的题目,一解法可用容斥原理(inclusion
exclusion principle)...
分类:
其他好文 时间:
2014-07-27 11:38:24
阅读次数:
198
#include
using namespace std;
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int ab=a+b-c,bc=b+c-a,ac=a+c-b;
if(ab>=0&&bc>=0&&ac>=0&&ab%2==0&&bc%2==0&&ac%2==0)
printf("%d %d...
分类:
其他好文 时间:
2014-07-27 11:14:02
阅读次数:
194
在n*n矩阵的对角线上输出k即可
#include
using namespace std;
int main()
{
int n,k;
scanf("%d%d",&n,&k);
for(int i=1;i<=n;i++)
{
for(int j=1;j<=n;j++)
{
if(j!=1)...
分类:
其他好文 时间:
2014-07-27 11:13:42
阅读次数:
311
算盘的模拟
#include
using namespace std;
int main()
{
char s[20];
scanf("%s",&s);
int len=strlen(s);
for(int i=len-1;i>=0;i--)
{
if(s[i]>='5'&&s[i]<='9')
{
...
分类:
其他好文 时间:
2014-07-27 11:11:42
阅读次数:
172
这题又是容斥原理,最近各种做容斥原理啊。当然,好像题解给的不是容斥原理的方法,而是用到Lucas定理好像。这里只讲容斥的做法。题意:从n个容器中总共取s朵花出来,问有多少种情况。其中告诉你每个盒子中有多少朵花。分析:其实就是求方程: x1+x2+...+xn = s 的整数解的个数,方程满足: 0=...
分类:
其他好文 时间:
2014-07-27 10:09:32
阅读次数:
234
Codeforces Round #258 (Div. 2) B. Sort the Array(简单题)...
分类:
其他好文 时间:
2014-07-26 15:21:53
阅读次数:
200
Codeforces Round #258 (Div. 2) A. Game With Sticks(数学题)...
分类:
其他好文 时间:
2014-07-26 15:21:26
阅读次数:
205