Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:题目过的越来越没水平了~~(附代码)

Posted by 117474335 at 2010-09-16 00:46:03 on Problem 3112
In Reply To:题目过的越来越没水平了~~(附代码) Posted by:zjp at 2009-08-24 14:59:52
#include <stdio.h>
int q[1000][1000], n, p, c , ans ;
main () 
{
    int i, j, t , k ;
    while (scanf ("%d%d%d", &p, &n, &c), p | c | n){
        ans = 0 ; 
        for (i = 0 ;i < n ; i ++ )
            for (j = 0 ; j < p ;j ++ )
                scanf ("%d", &q[i][j]) ; 
        for (i = 0 ; i < p ; i ++ ) 
            for (j = 0 , t = 0 , k = 1 ; j < n ; j ++ ){
                t += q[j][i] ; 
                if (t >= c && k){ ans ++ ; k = 0 ;}
                if ( ! q[j][i]){t = 0 ; k = 1 ;} }
         printf ("%d\n", ans) ;} 
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator