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 1654. Cipher Message

Why RE(AV) Test #6
Posted by PrankMaN 22 Mar 2013 01:03
#include <cstdio>

char a[300010], k;

int main(){
    char c;
    while((c = getchar()) != EOF){
        if(k == 0 || a[k - 1] != c)
            a[k++] = c;
        else
            k--;
    }
    for(int i = 0; i < k; i++)
        putchar(a[i]);
    return 0;
}

This one gives RE(AV) on the 6th test. I tried it 4 times with different sizes of array "a" (200000, 200010, 300010, 2000000) and each time got this error. I found it very strange, could you help me please?
Re: Why RE(AV) Test #6
Posted by Salimov Albert 24 Apr 2013 22:55
simple, int k(0);