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 1243. Divorce of the Seven Dwarfs

Can someone explain that?
Posted by kami_botanik 26 Mar 2013 16:12
I don't understand what's the hint in this problem! I read it and I think this code must be enough to solve that problem in c#:
using System;

namespace ConsoleApplication1
{
    class Program1243
    {
        static void Main()
        {
            ulong n = Convert.ToUInt64(Console.ReadLine());
            Console.WriteLine(n%7);

        }
    }
}

But I get WA#5. And I don't understand! Can someone help me? . . .
Re: Can someone explain that?
Posted by OZone 5 Apr 2013 04:25
10^50 does not fit into UInt64. BigInteger integer does.
However you could try to divide string by 7, or use some more sophiscated math (O(N), no divisions at all).