随笔—邀请赛前训— Codeforces Round #330 (Div. 2) Vitaly and Night
题意:给你很多对数,要么是0要么是1。不全0则ans++。
思路即题意。
#include<cstdio>
#include<cstring>
#include<iostream> using namespace std; #define MAX(x,y) (((x)>(y)) ? (x) : (y))
#define MIN(x,y) (((x) < (y)) ? (x) : (y))
#define ABS(x) ((x)>0?(x):-(x)) const int inf = 0x7fffffff;
const int N=; int win[N][*N];
int state[N];Z int main()
{
int n,m;
while(cin>>n>>m)
{
int cnt=;
for(int i=; i<=n; i++)
{
for(int j=; j<=*m; j++)
{
scanf("%d",&win[i][j]);
if(j% == ){
if(win[i][j-] == || win[i][j] == ){
cnt++;
}
}
}
}
cout<<cnt<<endl;
}
return ;
}
随笔—邀请赛前训— Codeforces Round #330 (Div. 2) Vitaly and Night的更多相关文章
- 随笔—邀请赛前训— Codeforces Round #330 (Div. 2) B题
题意: 这道英文题的题意稍稍有点复杂. 找长度为n的数字序列有多少种.这个序列可以分为n/k段,每段k个数字.k个数可以变成一个十进制的数Xi.要求对这每n/k个数,剔除Xi可被ai整除的情况,剔除X ...
- Codeforces Round #330 (Div. 1) A. Warrior and Archer 贪心 数学
A. Warrior and Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/594 ...
- Codeforces Round #330 (Div. 1) C. Edo and Magnets 暴力
C. Edo and Magnets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/594/pr ...
- Codeforces Round #330 (Div. 2)D. Max and Bike 二分 物理
D. Max and Bike Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/595/probl ...
- Codeforces Round #330 (Div. 2) B. Pasha and Phone 容斥定理
B. Pasha and Phone Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/595/pr ...
- Codeforces Round #330 (Div. 2) A. Vitaly and Night 暴力
A. Vitaly and Night Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/595/p ...
- Codeforces Round #330 (Div. 2)
C题题目出错了,unrating,2题就能有很好的名次,只能呵呵了. 水 A - Vitaly and Night /***************************************** ...
- Codeforces Round #330 (Div. 2) B. Pasha and Phone
B. Pasha and Phone time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Codeforces Round #330 (Div. 2) B 容斥原理
B. Pasha and Phone time limit per test 1 second memory limit per test 256 megabytes input standard i ...
随机推荐
- TCP发送接口的返回值
原文链接: http://blog.csdn.net/ordeder/article/details/17240221 1. TCP发送接口:send() TCP发送数据的接口有send,write, ...
- 腾讯优测优分享 | 探索react native首屏渲染最佳实践
腾讯优测是专业的移动云测试平台,旗下的优分享不定时提供大量移动研发及测试相关的干货~ 此文主要与以下内容相关,希望对大家有帮助. react native给了我们使用javascript开发原生app ...
- HDU 1568 double 快速幂
Fibonacci Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total S ...
- import tf
不知道为什么,tensorflow要最后import,否则会对matplotlib的imread产生影响,产生IO错误,异常莫名其妙
- 初学Html
HTML,超文本标记语言,文本解释性语言,它的源代码不通过编译而直接在浏览器中运行时被翻译,其决定的是网页的结构和内容. 一谈html,自然首先是浏览器,比较具有代表性的浏览器则是谷歌.火狐.IE.苹 ...
- poj1026 Cipher ——置换群
link:http://poj.org/problem?id=1026 其实这道题目和poj2369这道题目一样. 都是基础的置换群题目.把那道题目理解了,这道题就没问题了. 不过我的方法貌似比较挫, ...
- 应用aspose.word破解版实现word转pdf
import org.apache.log4j.LogManager; import org.apache.log4j.Logger; import java.io.File; import java ...
- TestDisk 恢复rm -rf 的文件
Linux操作系统下使用TestDisk恢复已删除的文件或目录 原创作者:szyzln/2015.10.16 转载需注明原始出处! 说明: testdisk和photorec是著名的恢复数据,而绝 ...
- Python中获取字典中最值对应的键
利用min(dict, key=dict.get) >>> d = {1:1, 2:0, 3:2} {1: 1, 2: 0, 3: 2} >>> min(d, ke ...
- Durid(二): 数据集及存储
druid有三种类型的数据结构: timestamp列,维度列,指标列. 时间撮和指标在底层都是int数组或long数组. 指标值是int或long,而时间撮为long. Segment文件的内部结构 ...