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 1023. Buttons

Why WA???????????????????
Posted by Retromaniac 11 Aug 2007 08:45
#include <stdio.h>
int K, L, i;
int main()
{
  scanf("%d", &K);
  for (L=2; L<K; L++)
   for (i=1; i<L; i++)
   if ((K-L-1)%(L+i)==0) goto stop;
stop: printf("%d", L);
  return 0;
}
Re: Why WA???????????????????
Posted by ilyamit 16 Oct 2007 23:56
Sorry my bad english.
1) You solve is "ploho_chitaetsya))"
2) You solve is very long.
The AC solve run for O(n^(1/2)), or O(sqrt(n)).