随笔—邀请赛前训— Codeforces Round #330 (Div. 2) Vitaly and Night

Posted Shawn_Ji

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了随笔—邀请赛前训— 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=110;

int win[N][2*N];
int state[N];Z

int main()
{
    int n,m;
    while(cin>>n>>m)
    {
        int cnt=0;
        for(int i=1; i<=n; i++)
        {
            for(int j=1; j<=2*m; j++)
            {
                scanf("%d",&win[i][j]);
                if(j%2 == 0){
                    if(win[i][j-1] == 1 || win[i][j] == 1){
                        cnt++;
                    }
                }
            }
        }
        cout<<cnt<<endl;
    }
    return 0;
}

 

以上是关于随笔—邀请赛前训— Codeforces Round #330 (Div. 2) Vitaly and Night的主要内容,如果未能解决你的问题,请参考以下文章

随笔—邀请赛前训— Codeforces Round #330 (Div. 2) Vitaly and Night

随笔—邀请赛前训—Codeforces Round #330 (Div. 2) B题

随笔—邀请赛前训—Wizards' Duel

随笔—邀请赛前训—Duff and Weight Lifting

随笔—邀请赛前练—CodeForces 588B

随笔—邀请赛前练— Codeforces Round #329 (Div. 2) 2Char