|
|
вернуться в форумok...i solved my TLE 6 and TLE 7 problems, now i think it s more than fast enough but i god WA#1 even though it gives good answers too all tests on my machine.... any ideas what s wrong ? can someone give me test 1 ? #include<iostream> #include<vector> using namespace std; int main(){
vector<char> tab; char x, previous; int size=0,j=0; while(!(cin >> x).eof()){ if(x!=previous){ tab.push_back(x); j++; previous=x; } else{ tab.pop_back(); j--; if(j>=1) previous = tab[j-1]; else previous = '!'; } } for( int i = 0; i < tab.size(); i++ ){ cout << tab[ i ]; } getchar();getchar(); } Edited by author 09.08.2011 19:27 try abhhcggcffbeedda answer must be an empty string and so it is. ... any other ideas ? i really dont know what else to do. You can't do a getchar() when the judge won't write any char! :p |
|
|