// UVa 11204 - Musical instruments #include <iostream> #include <string.h> using namespace std; int main() { int cases; for (cin >> cases; cases; cases--) { int n, m; cin >> n >> m; int pref[32]; memset(pref, 0, sizeof(pref)); for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { int a; cin >> a; if (a == 1) { pref[j]++; } } } unsigned long long sol = 1; for (int j = 0; j < n; j++) { if (pref[j] > 1) sol *= pref[j]; } cout << sol << endl; } return 0; }
Showing posts with label UVa 11204 - Musical instruments. Show all posts
Showing posts with label UVa 11204 - Musical instruments. Show all posts
Monday, November 23, 2015
UVa 11204 - Musical instruments
Subscribe to:
Posts (Atom)