Submission #889472

#TimeUsernameProblemLanguageResultExecution timeMemory
889472Lincito_31Arranging Shoes (IOI19_shoes)C++14
Compilation error
0 ms0 KiB
while(!s.empty()){ int temp=s[0]; if(temp<0){ for(int i=1;i<s.size();i++){ if(s[i]==-temp){ x+=i-1; s.erase(s.begin()+i); break; } } s.erase(s.begin()); }else{ for(int i=1;i<s.size();i++){ if(s[i]==-temp){ x+=i; s.erase(s.begin()+i); break; } } s.erase(s.begin()); } }

Compilation message (stderr)

shoes.cpp:1:1: error: expected unqualified-id before 'while'
    1 | while(!s.empty()){
      | ^~~~~