if any body wants to try it..try these two problems....
http://www.spoj.pl/problems/KAMIL/
&
http://www.spoj.pl/problems/SIZECON/
if any body wants to try it..try these two problems....
http://www.spoj.pl/problems/KAMIL/
&
http://www.spoj.pl/problems/SIZECON/
I think it would be best if you just stayed out of dumb contests instead.
Yes, those are DUMB STUPID contests.
Stay away from them! I MEAN IT!!!
"The Internet treats censorship as damage and routes around it." - John Gilmore
Well, they are not that stupid. I also notice that some/most don't have any real size restrictions. 10000 bytes of source code to add up positive integers isn't that bad, is it?
Well, 256 bytes for the first one (KAMIL) is a bit stupid. I would try that myself, but I don't understand the sample output (should be 2, not 4?!) given the rules. (Otherwise you'd start with 1, loop through each letter and multiply the result by how many ways there is to pronounce this letter?)
KAMIL:
That 256 bytes would include newlines, spaces and tabs!!Score
The score awarded to your program is the number of bytes the source code you submit. The fewer points you score, the better. Submissions are not allowed to exceed 256 bytes.
Remark. It may turn out impossible to solve this problem in some languages.
"The Internet treats censorship as damage and routes around it." - John Gilmore
They didn't say it needs to be typesafe. I can't think of anything better for the SIZECON contest.
It's C++.Code:#include <iostream> int main(){ int c,t,b; std::cin>>c; for(int i=0;i<c;i++){ std::cin>>b; if(c>0){ t+=b; } } std::cout<<t; return 0; }
"The Internet treats censorship as damage and routes around it." - John Gilmore
@maxorator
now chk my soln....
And for all that is a site dedicated for programming...its worth it..it has got the best collection of problems...from easy ones to tough graph algos...
@anon
the sample input is right...the soln is 2^(no of occurances of D+F+L+T)..so it is 4..
KAMIL contest is still pure stupidity.
"The Internet treats censorship as damage and routes around it." - John Gilmore
Relax, you may use spaces and newlines.Originally Posted by nardneran
"The Internet treats censorship as damage and routes around it." - John Gilmore
Why do they need to restrict score on source code size?
Yup, they should check it for standards, typesafety etc.
I am sure you could find many many such mistakes from almost every entry.
Now, let's rate his code:Code:#define b scanf("%d",& t,a,n; main(){ for(b t);t--;a+=n*(n>0)) b n); printf("%d",a); return 0;}
Maximum points 1000
no header files > -50
int missing before var names > -100
confusing use of macros > -50
int missing before main > -100
no newlines, spaces nor tabs >-100
it is not typesafe > -200
Total points 400
Hmm... 400 OF 1000... try again!
Last edited by maxorator; 10-15-2006 at 02:30 AM.
"The Internet treats censorship as damage and routes around it." - John Gilmore
Bah... cheap imitations.
Insist on the original.
Code:#include <stdio.h> void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){ puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9 /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i] ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][ t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}
You can never know who was there first...
There may be hundreds of others too...
"The Internet treats censorship as damage and routes around it." - John Gilmore
IOCCC is the tue origional. They're the champs. Contrary to popular belief, immitation is [i]not[/] the sincerest form of flattery.
Quzah.
Hope is the first step on the road to disappointment.