|
|
вернуться в форумSomething strange... 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... Послано nikita 20 июн 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 |
|
|