Codeforces 595A Vitaly and Night

#define _CRT_SECURE_NO_WARNINGS
#include 
#include 
#include 
#include 

using namespace std;

int n, m;
int temp[105][205];
int ans;

int main() {
	scanf("%d %d", &n, &m);
	for (int i = 1;i <= n;++i) {
		for (int j = 1;j <= 2 * m;j += 2) {
			scanf("%d %d", &temp[i][j], &temp[i][j + 1]);
			if (temp[i][j] == 1 || temp[i][j + 1] == 1) {
				ans++;
			}
		}
	}
	printf("%d\n", ans);
	//system("pause");
	return 0;
}

 

你可能感兴趣的:(ACM)