ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1095. Nikifor 3

Posted by Li Yi 6 Oct 2001 13:46
Posted by Huang Yizheng 1 Nov 2001 17:48
>I think only search is okey.
Posted by Coldfeel 30 Mar 2003 15:07
>I think only search is okey.

ur solution is not good.

the better way is use remainder(mod)
Posted by Kit 12 Apr 2005 00:12
I wanna offer my solution (I think, author had in view same method).
Arrange digits of the number in a such way:
(non-zero digits in arbitrary order)1234(all zeroes).
Then, we can permute only 1234 among them in order to receive a number, dividing by 7 (You can prove it).

Edited by author 12.04.2005 01:20
Posted by Nickolas 26 Feb 2008 18:59
Is anybody willing to tell me why it works?
Posted by unlucky [Vologda SPU] 23 Feb 2010 14:04
Kit wrote 12 April 2005 00:12
I wanna offer my solution (I think, author had in view same method).
Arrange digits of the number in a such way:
(non-zero digits in arbitrary order)1234(all zeroes).
Then, we can permute only 1234 among them in order to receive a number, dividing by 7 (You can prove it).

Edited by author 12.04.2005 01:20
No sorting, just "cutting" one : 1,2,3,4 from input number; selecting zeros and constructing "possible answer" :)