http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2145
中譯
http://luckycat.kshs.kh.edu.tw/homework/q11204.htm
#include "stdio.h" int main() { int num,i,j,k,total; scanf(" %d",&num); for(i = 0;i < num;i++) { int N,M,tmp,first[32]={0},times = 1; scanf(" %d %d",&N,&M); for(j = 0;j < M;j++) { for(k =0;k < N;k++) { scanf(" %d",&tmp); if( tmp == 1 ) first[k] += 1; } } for(j = 0;j < N;j++) { if( first[j] > 0) { times *= first[j]; } } printf("%d\n",times); } return 0; }
沒有留言:
張貼留言