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 1423. String Tale

Strange compilation error
Posted by Georgiy Platonov 17 Dec 2012 10:51
I have strange problem, my code is compiled well on my home PC (MS VC++ 2010 also), but the same code getting compilation error on Timus.
Let me present here a fragment of my code (All problem-related part was expunged, only variable declaration-initialization and input remained). This is also a compilable code on my PC. Can you consider it please. Thanks in advance.

#pragma comment(linker, "/STACK:5000000")
#include <iostream>
using namespace std;

int main()
{
    char tmp, or[250001], samp[750002];
    int N, z[750002];
    memset(&z[0], 0, 750002*4);
    scanf("%i", &N);
    scanf("%c", &tmp);
    cin.getline(or, 250001);
    cin.getline(samp, 750002);
    return 0;
}

Code above gives CE on Timus:

8002b36b-0800-4fc8-aa2b-53e6cb233ddd
8002b36b-0800-4fc8-aa2b-53e6cb233ddd(7) : error C2059: syntax error : '||'
8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2143: syntax error : missing ')' before '||'
8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2661: 'std::basic_istream<_Elem,_Traits>::getline' : no overloaded function takes 0 arguments
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2059: syntax error : ','
8002b36b-0800-4fc8-aa2b-53e6cb233ddd(12) : error C2059: syntax error : ')'
8002b36b-0800-4fc8-aa2b-53e6cb233ddd(13) : error C2065: 'samp' : undeclared identifier
Re: Strange compilation error
Posted by Erop [USU] 17 Dec 2012 16:37
try rename array "or", I think it can resolve problem
Re: Strange compilation error
Posted by Georgiy Platonov 17 Dec 2012 17:58
Thanks, the idea of renaming really worked!