Блог пользователя Nooor

Автор Nooor, 10 лет назад, По-английски

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

Теги mle
  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
10 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

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 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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 лет назад, # |
Rev. 5   Проголосовать: нравится 0 Проголосовать: не нравится

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 .