CodeForce 832A Sasha and Sticks】的更多相关文章

A. Sasha and Sticks time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and…
It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends. Today he invented one simple game to play with Lena, with whom he shares a desk. The rules…
It's one more school day now. Sasha doesn't like classes and is always bored at them. So, each day he invents some game and plays in it alone or with friends. Today he invented one simple game to play with Lena, with whom he shares a desk. The rules…
[Link]: [Description] [Solution] 傻逼题; 获取n/k; 对n/k的奇偶性讨论一下就好 [NumberOf WA] 0 [Reviw] [Code] #include <bits/stdc++.h> #define LL long long using namespace std; LL n,k; int main(){ //freopen("F:\\rush.txt","r",stdin); scanf("%l…
A. Sasha and Sticks 水题,判断一下次数的奇和偶就可以的. B. Petya and Exam 赛上的时候没有写出来,orz,记录一下吧. 题意:给出一个模式串,可能会有?和*两种符号,*最多有一个.?可以被好的字符代替,*可以被空串,坏的字符,坏的字符串代替,现在给出n个字符串,问这些字符串是否满足要求.好的字符在开头已经给出. 思路: 对于不包含*的串,直接判断?位置的是否都为好字符就ok了. 对于包含*的串,做如下处理,首先把*代表的bad串提取出来,再把模式串中的*擦除…
A. Sasha and Sticks 题目链接:http://codeforces.com/contest/832/problem/A 题目意思:n个棍,双方每次取k个,取得多次数的人获胜,Sasha先取,问Sasha是否可以取胜. 代码: //Author: xiaowuga #include <iostream> #include <algorithm> #include <set> #include <vector> #include <que…
来源:点击打开链接 非常easy.找规律. 每去掉一个点,点的总数量就减去n+m-1,然后看谁最先减到没有点可减.就能够了. #include <iostream> #include <cstring> using namespace std; int main() { int n,m; cin>>n>>m; int totalpoint=n*m; int count=0; while(totalpoint>0) { totalpoint-=(n+m-…
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 15564    Accepted Submission(s): 6405 Problem Description There is a pile of n wooden sticks. The length and weight of each stick a…
题意:给你n条线段依次放到二维平面上,问最后有哪些没与前面的线段相交,即它是顶上的线段 题解:数据弱,正向纯模拟可过 但是有一个陷阱:如果我们从后面向前枚举,找与前面哪些相交,再删除前面那些相交的线段,这样就错了 因为如果线段8与5,6,7相交了,我们接下来不能直接判断4,我们还要找7,6,5与之前哪些相交 #include<set> #include<map> #include<queue> #include<stack> #include<cmat…
C. Sasha and Array time limit per test:5 seconds memory limit per test:256 megabytes input:standard input output: standard output Sasha has an array of integers a1, a2, ..., an. You have to perform m queries. There might be queries of two types: 1 l…