QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#68084#4585. Greedy KnapsackZhaoZiLongCompile Error//C++981.1kb2022-12-14 16:30:182022-12-14 16:30:18

Details

answer.code: In function ‘int main()’:
answer.code:40:26: error: ‘t’ does not name a type; did you mean ‘tm’?
   40 |                 for(auto t:o)mp[t.fi]=max(mp[t.fi],t.se);
      |                          ^
      |                          tm
answer.code:40:58: error: expected ‘;’ before ‘if’
   40 |                 for(auto t:o)mp[t.fi]=max(mp[t.fi],t.se);
      |                                                          ^
      |                                                          ;
   41 |                 if(w[i]<=l)l-=w[i],r-=w[i],sum+=v[i];
      |                 ~~                                        
answer.code:41:17: error: expected primary-expression before ‘if’
   41 |                 if(w[i]<=l)l-=w[i],r-=w[i],sum+=v[i];
      |                 ^~
answer.code:40:58: error: expected ‘;’ before ‘if’
   40 |                 for(auto t:o)mp[t.fi]=max(mp[t.fi],t.se);
      |                                                          ^
      |                                                          ;
   41 |                 if(w[i]<=l)l-=w[i],r-=w[i],sum+=v[i];
      |                 ~~                                        
answer.code:41:17: error: expected primary-expression before ‘if’
   41 |                 if(w[i]<=l)l-=w[i],r-=w[i],sum+=v[i];
      |                 ^~
answer.code:40:58: error: expected ‘)’ before ‘if’
   40 |                 for(auto t:o)mp[t.fi]=max(mp[t.fi],t.se);
      |                    ~                                     ^
      |                                                          )
   41 |                 if(w[i]<=l)l-=w[i],r-=w[i],sum+=v[i];
      |                 ~~                                        
answer.code:45:18: error: ‘t’ does not name a type; did you mean ‘tm’?
   45 |         for(auto t:mp)res=max(res,t.se);
      |                  ^
      |                  tm
answer.code:45:41: error: expected ‘;’ before ‘cout’
   45 |         for(auto t:mp)res=max(res,t.se);
      |                                         ^
      |                                         ;
   46 |         cout<<res<<endl;
      |         ~~~~                             
answer.code:47:9: error: expected primary-expression before ‘return’
   47 |         return 0;
      |         ^~~~~~
answer.code:46:25: error: expected ‘)’ before ‘return’
   46 |         cout<<res<<endl;
      |                         ^
      |                         )
   47 |         return 0;
      |         ~~~~~~           
answer.code:45:12: note: to match this ‘(’
   45 |         for(auto t:mp)res=max(res,t.se);
      |            ^