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 1001. Reverse Root

C# WA :(
Posted by DavidSekar 17 Nov 2008 16:51
using System;
using System.IO;

namespace root
{
    class Program
    {
        static void Main(string[] args)
        {
            byte[] buf = new byte[300000];
            int read = Console.OpenStandardInput().Read(buf, 0, 300000);
            int idx=read;
            //StreamWriter outbuff = new StreamWriter(Console.OpenStandardOutput());
            while (idx-- >= 0)
            {
                while (buf[idx] < '0') idx--;
                double n=0,r,mul=1;
                while ((r = buf[idx--] - '0') >= 0)
                {
                    n = n + r * mul;
                    mul *= 10;
                }
                Console.WriteLine(Math.Sqrt(n).ToString("0.0000"));
            }
            //outbuff.Flush();
        }
    }
}


i used long for N but still wrong answer.

Plz pin point my mistake