QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#718335#415. 最小生成树GuanYunchangCompile Error//C++111.3kb2024-11-06 20:17:242024-11-06 20:17:26

詳細信息

answer.code: In function ‘void read(T&)’:
answer.code:21:12: error: there are no arguments to ‘getchar’ that depend on a template parameter, so a declaration of ‘getchar’ must be available [-fpermissive]
   21 |     char c=getchar();
      |            ^~~~~~~
answer.code:21:12: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
answer.code:22:24: error: there are no arguments to ‘getchar’ that depend on a template parameter, so a declaration of ‘getchar’ must be available [-fpermissive]
   22 |     for(;!isdigit(c);c=getchar());
      |                        ^~~~~~~
answer.code:23:23: error: there are no arguments to ‘getchar’ that depend on a template parameter, so a declaration of ‘getchar’ must be available [-fpermissive]
   23 |     for(;isdigit(c);c=getchar())x=x*10+c-48;
      |                       ^~~~~~~
answer.code: In function ‘int main()’:
answer.code:65:5: error: ‘printf’ was not declared in this scope
   65 |     printf("%lld",ans);
      |     ^~~~~~
answer.code:3:1: note: ‘printf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
    2 | #include <cctype>
  +++ |+#include <cstdio>
    3 | #include <vector>
answer.code: In instantiation of ‘void read(T&) [with T = int]’:
answer.code:34:9:   required from here
answer.code:21:19: error: ‘getchar’ was not declared in this scope
   21 |     char c=getchar();
      |            ~~~~~~~^~
answer.code:21:19: note: ‘getchar’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?