|  | 
|  | 
| back to board | WA#1...am out of ideas. HELP Posted by Tom  9 Aug 2011 02:06ok...i solved my TLE 6 and TLE 7 problems, now i think it s more than fast enoughbut 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
Re: WA#1...am out of ideas. HELP Posted by hatred  10 Aug 2011 04:49tryabhhcggcffbeedda
 
 answer must be an empty string
Re: WA#1...am out of ideas. HELP Posted by Tom  10 Aug 2011 14:53and so it is....
 any other ideas ?
 i really dont know what else to do.
Re: WA#1...am out of ideas. HELP You can't do a getchar() when the judge won't write any char! :p | 
 | 
|