ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1091. Tmutarakan Exams

What's wrong with my solution?
Posted by HELLER 23 Apr 2002 20:06
My solution in pseudo code:

res:=0;
for k:=2 to 23 (every k is prime) do
 a:=amount of numbers i (2<=i<=S),that i%k==0;
 b:=amount of numbers i (2<=i<=S), that i%n==0 , where n - any prime
less than k
 if (a>=K)
 res+=Combinations(a,K);
 if (b>=K)
 res-=Combinations(b,K);
 if (res>=10000) then ...
end

write(res) ...

WA, and I dont know why. My prog gives right answer on tests written
here and in sample input, but WA.

Help, please