QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#67001#4585. Greedy KnapsackGuanYunchangCompile Error//C111.1kb2022-12-09 16:12:242022-12-09 16:12:26

詳細信息

answer.code:1:9: error: #include expects "FILENAME" or <FILENAME>
 #include?bits/stdc++.h?
         ^
answer.code:5:1: error: unknown type name ‘using’
 using namespace std;
 ^~~~~
answer.code:5:17: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘std’
 using namespace std;
                 ^~~
answer.code: In function ‘read’:
answer.code:8:9: warning: implicit declaration of function ‘getchar’ [-Wimplicit-function-declaration]
  char c=getchar();int x=0;bool f=0;
         ^~~~~~~
answer.code:8:9: note: ‘getchar’ is defined in header ‘<stdio.h>’; did you forget to ‘#include <stdio.h>’?
answer.code:1:1:
+#include <stdio.h>
 #include?bits/stdc++.h?
answer.code:8:9:
  char c=getchar();int x=0;bool f=0;
         ^~~~~~~
answer.code:8:27: error: unknown type name ‘bool’; did you mean ‘_Bool’?
  char c=getchar();int x=0;bool f=0;
                           ^~~~
                           _Bool
answer.code:9:8: warning: implicit declaration of function ‘isdigit’ [-Wimplicit-function-declaration]
  for(;!isdigit(c);c=getchar())f^=!(c^45);
        ^~~~~~~
answer.code: At top level:
answer.code:18:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
 typedef pair<int,int>pii;
             ^
answer.code:19:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
 typedef vector<int>vi;
               ^
answer.code:25:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘<’ token
 map<int,int>mp;
    ^
answer.code: In function ‘main’:
answer.code:30:27: warning: implicit declaration of function ‘max’; did you mean ‘maxn’? [-Wimplicit-function-declaration]
  For(i,1,n)w[i]=read(),mx=max(mx,w[i]);
                           ^~~
                           maxn
answer.code:34:3: error: ‘vector’ undeclared (first use in this function)
   vector<pii>o;
   ^~~~~~
answer.code:34:3: note: each undeclared identifier is reported only once for each function it appears in
answer.code:34:10: error: ‘pii’ undeclared (first use in this function)
   vector<pii>o;
          ^~~
answer.code:34:14: error: ‘o’ undeclared (first use in this function)
   vector<pii>o;
              ^
answer.code:35:9: error: ‘mp’ undeclared (first use in this function); did you mean ‘mx’?
   while(mp.size() && (--mp.end())->fi>=w[i]){
         ^~
         mx
answer.code:36:7: error: expected ‘;’ before ‘t’
    pii t=*(--mp.end()); mp.erase(t.fi);
       ^~
       ;
answer.code:36:34: error: ‘t’ undeclared (first use in this function)
    pii t=*(--mp.end()); mp.erase(t.fi);
                                  ^
answer.code:17:13: warning: implicit declaration of function ‘make_pair’ [-Wimplicit-function-declaration]
 #define mkp make_pair
             ^~~~~~~~~
answer.code:37:9: note: in expansion of macro ‘mkp’
    o.pb(mkp(w[i]-1,t.se));
         ^~~
answer.code:40:13: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
   for(auto t:o)mp[t.fi]=max(mp[t.fi],t.se);
             ^
answer.code:45:12: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘:’ token
  for(auto t:mp)res=max(res,t.se);
            ^
answer.code:46:2: error: ‘cout’ undeclared (first use in this function)
  cout<<res<<endl;
  ^~~~
answer.code:46:13: error: ‘endl’ undeclared (first use in this function)
  cout<<res<<endl;
             ^~~~