Sphere Online Judge

SPOJ Problem Set (challenge)

378. Size Contest

Problem code: SIZECON

Given the set of integers, find the sum of all positive integers in it. Solutions can be sent in any language supported by SPOJ except Whitespace.

Input

t – number of test cases [t < 1000]
On each of next t lines given a integer N [-1000 <= N <= 1000]

Output

One integer equals to sum of all positive integers.

Score

Score equals to size of source code of your program except symbols with ASCII code <= 32.

Example

Input:
4
5
-5
6
-1
Output:
11

Added by:Roman Sol
Date:2005-06-23
Time limit:2s
Source limit:10000B
Memory limit:256MB
Cluster: Pyramid (Intel Pentium III 733 MHz)
Languages:All except: ERL JS NODEJS PERL 6 WSPC
Resource:ZCon & RSDN

hide comments
2013-04-09 19:16:04 ওয়াসী (Wasi)
i got 57 in python 3.2.3 I wonder how numerix solved it with only 36 chars!!!

Last edit: 2013-04-18 20:48:01
2013-02-27 21:16:10 @@@
i gt 161 what does it mean
2012-12-24 13:38:22 Atul Kumar Verma
@nikhil the number you get is the total of characters used in code. as small number you get more better is your code.
2012-10-18 16:30:22 gourav
what does 128 means ? 127 is good than 128 or bad ? tell me please!!
2012-10-16 17:02:27 :)
#include
int main(){
int t;
scanf("%d",&t);
int i,a,sum=0;
for(i=0;i {
scanf("%d",&a);
if(a>0)sum+=a;
}
printf("%d",sum);
return 0;
}
what is wrong with this code?
it is giving WA
2012-07-25 20:18:44 Mostafa 36a2 (Al3ayesh)
___What A PERL !!!!


Last edit: 2012-08-10 18:13:55
2012-07-17 11:26:02 Shubham.IIITM
i gt 75 what does it mean
2011-10-26 19:06:20 Asmageddon
My solution works with all test cases I prepared for it, but here it says it's wrong. I have tried with both a newspace appended to the end of string and without. Am I missing something?
2011-10-14 04:14:29 Weicheng Gao
the bigger your source codes, the worse your score.
2011-10-11 05:29:43 Ashwin Menon
@Grandmaster: Code is judged as a whole, not based on language.
SPOJ © 2013 Sphere Research Labs. All Rights Reserved.