Nooor's blog

By Nooor, 10 years ago, In English

Hello

I am a newbie in this field and I have tried to solve such a trivial problem, first time my code got wrong answer on test 6 then I fixed it and it's getting MLE, I tried so much to recognize why my code crams the memory down but I culminated with no thing, here is my submission I would be so grateful if anyone could help me ! Thanks in advance

Tags mle
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
10 years ago, # |
  Vote: I like it +1 Vote: I do not like it

In this problem you don't need to store all the input. You can do something like:

string s;
while(cin>>s){
    doThings(s);
    ...
    cout << answer << endl;
}
»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Carefully analyse the behaviour of the following snippet from your program:

                while(true)
                {
                    if(quotient <= 26) { col += quotient-1 + 'A'; break; }
                    reminder = quotient % 26;
                    quotient = co / 26 ;
                    if(reminder == 0) { quotient--; col += 'Z'; }
                    else col += reminder-1 + 'A';
                }

Check for example:

Input

3
R1C701
R1C702
R1C703

Output

ZY1
ZZ1
AAA1
»
10 years ago, # |
Rev. 5   Vote: I like it 0 Vote: I do not like it

Thank you all :))

Thanks mrGRR ,Special Thanks lbv

I got it It was an inadvertent mistake I shouldn't fall in .

I took care about it in the previous submission but after I fixed it, I dropped it inadvertently and I spent much time on this problem so I got nervous and I didn't realize it, I had to reread my code carefully, thank you for taking time to read my post and answer me, sorry for bothering .