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

Wrong answer 3 Help pls: )
Posted by Tom 4 Aug 2011 00:20
what s test 3 ?

#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;

int main(){

    long double x;
    int i=0;
    long double tab[32768];

    cout << setprecision(4) << fixed;
    cin >> x;
    while(!cin.eof()){
              tab[i]=sqrt(x);
              i+=1;
              cin >> x;
              }
    for(int k=0;k<i;k++){
                   cout << tab[i-1-k] << endl;
                   }
                   getchar();getchar();
    }
Re: Wrong answer 3 Help pls: )
Posted by Shizhouxing 4 Aug 2011 09:36
Don't use "cout" or "cin",because they're not fast.
Re: Wrong answer 3 Help pls: )
Posted by hatred 4 Aug 2011 16:20
may be array tab is too small
Re: Wrong answer 3 Help pls: )
Posted by Tom 5 Aug 2011 14:21
WA is not about speed mate, besides my guess is they r fast enough here: )
thx anyway, will remember it

WA is not about array size either. is would be memory crash than or smh like that
thx again

any other suggestions ?

Edited by author 05.08.2011 14:24

Edited by author 05.08.2011 14:24