QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#65688#4585. Greedy KnapsackZhangYiDeCompile Error//C++981.1kb2022-12-02 21:45:272022-12-02 21:45:28

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;
      |         ~~~~                             
answer.code:47:9: error: expected primary-expression before ‘return’
   47 |         return 0;
      |         ^~~~~~
answer.code:46:19: error: expected ‘)’ before ‘return’
   46 |         cout<<res;
      |                   ^
      |                   )
   47 |         return 0;
      |         ~~~~~~     
answer.code:45:12: note: to match this ‘(’
   45 |         for(auto t:mp)res=max(res,t.se);
      |            ^