|
|
back to boardSomething strange... Posted by Vukasin 23 Apr 2009 18:28 When i write my program like: #include<cstdio> long long int i,k; int main(){ scanf("%lld",&k); i=k / 3; while(k % i!=0){ i=k /(k / i +1); } i got AC,but when i change it to: #include<cstdio> int main(){ long long int i,k; scanf("%lld",&k); i=k / 3; while(k % i!=0){ i=k /(k / i +1); } printf("%lld",(k / i-1)); } printf("%lld",(k / i-1)); } i got WA5...does anyoe know how is that possible? Re: Something strange... Posted by nikita 20 Jun 2009 17:04 wtf i=k / 3; ?? If k%(l+1)==0 then 2nd have a chance to win. And 1st wins if k%(l+1)!=0 try it: for (l=3;k%l!=0;l++);; Re: Something strange... Edited by author 31.03.2017 14:34 |
|
|