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 1017. Staircases

Very strange -- CE
Posted by Tbilisi SU: Andrew Lutsenko 9 May 2006 12:44
here's part of my code:
int main(){
    long long a[501]={0};
    ......................
    cout<<a[n];
    return 0;
}

and this is reply on my e-mail:

You tried to solve problem 1017 The Staircases.
Your solution was compiled with the following errors:

bdaa8c64-fc2a-48e3-930d-26de8f4f79d6
bdaa8c64-fc2a-48e3-930d-26de8f4f79d6(15): error: more than one operator "<<" matches these operands:
            function "ostream::operator<<(char)"
            function "ostream::operator<<(unsigned char)"
            function "ostream::operator<<(signed char)"
            function "ostream::operator<<(short)"
            function "ostream::operator<<(unsigned short)"
            function "ostream::operator<<(int)"
            function "ostream::operator<<(unsigned int)"
            function "ostream::operator<<(long)"
            function "ostream::operator<<(unsigned long)"
            function "ostream::operator<<(float)"
            function "ostream::operator<<(double)"
            function "ostream::operator<<(long double)"
            operand types are: ostream_withassign << __int64
      cout<<a[n];
          ^

compilation aborted for bdaa8c64-fc2a-48e3-930d-26de8f4f79d6 (code 2)

Now can somebody explain THIS??!!?!
I read the FAQ and theres definitly said that u may use
cin and cout for Long Long

P.S. the same solution in Pascal got AC :/

P.P.S and even more!
 this fake solution:
#include <iostream.h>

int main()
{
    long long n;
    cin>>n;
    cout<<n;
    return 0;
}

gets compilation errors on cin>>n and cout<<n also!!!!

Edited by author 09.05.2006 12:51
Re: Very strange -- CE
Posted by Vladimir Yakovlev (USU) 9 May 2006 15:31
Such code works

#include <iostream>
using namespace std;

int main()
{
    long long n;
    cin>>n;
    cout<<n;
    return 0;
}

Sorry, FAQ needs to be updated.