CSP2024-S GD 迷惑行为大赏:编译错误(版本二)

全部信息的,只有部分被去重,观感可能不如这个版本好:https://www.cnblogs.com/caijianhong/p/18526161

学统计学的

共 12406 个 .cpp 文件,成功产生 18946 行、100017 词、1368719 字节的编译错误,其中 712 个文件编译失败,11695 个文件编译通过。

第一份编译错误出现在 answers/GD-S00002/duel/duel.cpp。
最后一份编译错误出现在 answers/GD-S03532/color/color.cpp。

编译错误信息长度:行的前 5 名:

complie answers/GD-S00981/detect/detect.cpp: 1458 lines, 8114 words, 122830 bytes
complie answers/GD-S01477/duel/duel.cpp: 803 lines, 3659 words, 61169 bytes
complie answers/GD-S01041/detect/detect.cpp: 738 lines, 4053 words, 61887 bytes
complie answers/GD-S02925/arena/arena.cpp: 731 lines, 4150 words, 60028 bytes
complie answers/GD-S02146/color/color.cpp: 730 lines, 4010 words, 58868 bytes

词的前 5 名(词按照空格分隔):

complie answers/GD-S00981/detect/detect.cpp: 1458 lines, 8114 words, 122830 bytes
complie answers/GD-S02925/arena/arena.cpp: 731 lines, 4150 words, 60028 bytes
complie answers/GD-S01041/detect/detect.cpp: 738 lines, 4053 words, 61887 bytes
complie answers/GD-S02146/color/color.cpp: 730 lines, 4010 words, 58868 bytes
complie answers/GD-S00960/duel/duel.cpp: 722 lines, 3976 words, 59318 bytes

字节的前 5 名:

complie answers/GD-S00981/detect/detect.cpp: 1458 lines, 8114 words, 122830 bytes
complie answers/GD-S01041/detect/detect.cpp: 738 lines, 4053 words, 61887 bytes
complie answers/GD-S01477/duel/duel.cpp: 803 lines, 3659 words, 61169 bytes
complie answers/GD-S02925/arena/arena.cpp: 731 lines, 4150 words, 60028 bytes
complie answers/GD-S00960/duel/duel.cpp: 722 lines, 3976 words, 59318 bytes

answers/GD-S00981/detect/detect.cpp 这份代码毫无疑问获得本次比赛广东省最长编译错误称号,取得了 1458 行,122KB 的好成绩!翻看其代码发现他试图 cin 和 cout std::queue

分类

无 main

complie: answers/GD-S00045/arena/arena.cpp
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x24): undefined reference to `main'
collect2: error: ld returned 1 exit status

荣获全广东第一个(文件名字典序最小)的无 main 函数代码称号,在 \(147\) 份无 main 代码中脱颖而出!

变量重名

answers/GD-S00157/color/color.cpp:22:6: error: conflicting declaration ‘int a’
answers/GD-S00583/color/color.cpp:4:11: error: conflicting declaration ‘const int n’
answers/GD-S00661/color/color.cpp:3:23: error: conflicting declaration ‘int t [1000001]’
answers/GD-S00979/detect/detect.cpp:19:6: error: conflicting declaration ‘int snb’
answers/GD-S01398/arena/arena.cpp:6:5: error: conflicting declaration ‘int inq [21][100010]’
answers/GD-S01436/detect/detect.cpp:3:25: error: conflicting declaration ‘int v [100010]’
answers/GD-S02119/arena/arena.cpp:16:11: error: conflicting declaration ‘long long int a [100005]’
answers/GD-S02147/arena/arena.cpp:12:9: error: conflicting declaration ‘std::string a’
answers/GD-S02334/detect/detect.cpp:13:14: error: conflicting declaration ‘int v [(n + 5)]’
answers/GD-S02925/arena/arena.cpp:10:6: error: conflicting declaration ‘char c’
answers/GD-S02960/detect/detect.cpp:7:32: error: conflicting declaration ‘int v [10001][10001]’
answers/GD-S03065/arena/arena.cpp:6:12: error: conflicting declaration ‘ll m [100001]’
answers/GD-S03135/arena/arena.cpp:15:7: error: conflicting declaration ‘bool a [K][K]’

有一部分是意外,有一部分是没写完,剩下的不知道想干嘛。。。

O2

./answers/GD-S00177/color/color.cpp:#pragma GCC optimize(2)
./answers/GD-S00177/detect/detect.cpp:#pragma GCC optimize(2)
./answers/GD-S00177/duel/duel.cpp:#pragma GCC optimize(2)
./answers/GD-S01758/detect/detect.cpp://#pragma GCC octime(2)

GD-S00177 要寄了

超过空间限制

complie: answers/GD-S00213/arena/arena.cpp
/tmp/ccCBQ6dz.o: in function `main':
arena.cpp:(.text.startup+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccCBQ6dz.o

编译错误,内存超出限制!!!这是第一份代码,后面还有

answers/GD-S00213/arena/arena.cpp
answers/GD-S00263/detect/detect.cpp
answers/GD-S00294/detect/detect.cpp
answers/GD-S00469/detect/detect.cpp
answers/GD-S00521/color/color.cpp
answers/GD-S00902/color/color.cpp
answers/GD-S00932/detect/detect.cpp
answers/GD-S01036/color/color.cpp
answers/GD-S01070/detect/detect.cpp
answers/GD-S01287/arena/arena.cpp
answers/GD-S01394/color/color.cpp
answers/GD-S01459/color/color.cpp
answers/GD-S01790/color/color.cpp
answers/GD-S01923/detect/detect.cpp
answers/GD-S01950/color/color.cpp
answers/GD-S01950/detect/detect.cpp
answers/GD-S01977/color/color.cpp
answers/GD-S02007/arena/arena.cpp
answers/GD-S02106/detect/detect.cpp
answers/GD-S02196/arena/arena.cpp
answers/GD-S02287/arena/arena.cpp
answers/GD-S02741/color/color.cpp
answers/GD-S02931/detect/detect.cpp

等选手

神秘字符

answers/GD-S00960/detect/detect.cpp:10:9: error: stray ‘\251’ in program
answers/GD-S00960/detect/detect.cpp:10:10: error: stray ‘\’ in program
answers/GD-S00960/detect/detect.cpp:11:9: error: stray ‘\251’ in program
answers/GD-S00960/detect/detect.cpp:11:10: error: stray ‘\’ in program
answers/GD-S01384/detect/detect.cpp:78:14: error: stray ‘#’ in program
answers/GD-S01802/detect/detect.cpp:3:18: error: stray ‘\243’ in program
answers/GD-S01802/detect/detect.cpp:3:19: error: stray ‘\273’ in program
answers/GD-S01802/detect/detect.cpp:3:18: error: stray ‘\243’ in program
answers/GD-S01802/detect/detect.cpp:3:19: error: stray ‘\273’ in program
answers/GD-S01802/detect/detect.cpp:3:18: error: stray ‘\243’ in program
answers/GD-S01802/detect/detect.cpp:3:19: error: stray ‘\273’ in program
answers/GD-S03505/color/color.cpp:5:2: error: stray ‘\’ in program

撞名标准库

answers/GD-S00016/color/color.cpp:7:25: error: ‘long long int index [200005]’ redeclared as different kind of entity
answers/GD-S00371/duel/duel.cpp:4:34: error: ‘int kill’ redeclared as different kind of entity
answers/GD-S00549/duel/duel.cpp:4:44: error: ‘int kill [100005]’ redeclared as different kind of entity
answers/GD-S01112/duel/duel.cpp:8:12: error: ‘bool kill [100005]’ redeclared as different kind of entity
answers/GD-S01779/detect/detect.cpp:8:5: error: ‘int index’ redeclared as different kind of entity
answers/GD-S02155/duel/duel.cpp:8:5: error: ‘long long int kill’ redeclared as different kind of entity
answers/GD-S02869/detect/detect.cpp:14:17: error: ‘bool kill [100010]’ redeclared as different kind of entity
answers/GD-S02945/duel/duel.cpp:6:15: error: ‘long long int kill [11451]’ redeclared as different kind of entity
answers/GD-S03145/duel/duel.cpp:4:32: error: ‘bool kill [100005]’ redeclared as different kind of entity
answers/GD-S03306/detect/detect.cpp:12:21: error: ‘bool bzero’ redeclared as different kind of entity
answers/GD-S03421/detect/detect.cpp:12:36: error: ‘int yn [1000005]’ redeclared as different kind of entity

悲报啊!

answers/GD-S00193/detect/detect.cpp:151:5: error: reference to ‘rend’ is ambiguous
answers/GD-S00193/detect/detect.cpp:152:5: error: reference to ‘rend’ is ambiguous
answers/GD-S00193/detect/detect.cpp:161:9: error: reference to ‘rend’ is ambiguous
answers/GD-S00193/detect/detect.cpp:161:16: error: reference to ‘rend’ is ambiguous
answers/GD-S00193/detect/detect.cpp:166:12: error: reference to ‘rend’ is ambiguous
answers/GD-S00193/detect/detect.cpp:170:12: error: reference to ‘rend’ is ambiguous
answers/GD-S00193/detect/detect.cpp:172:10: error: reference to ‘rend’ is ambiguous
answers/GD-S01640/color/color.cpp:11:9: error: reference to ‘next’ is ambiguous
answers/GD-S01640/color/color.cpp:11:23: error: reference to ‘next’ is ambiguous
answers/GD-S01640/color/color.cpp:16:4: error: reference to ‘next’ is ambiguous
answers/GD-S01640/color/color.cpp:17:16: error: reference to ‘next’ is ambiguous
answers/GD-S01640/color/color.cpp:17:26: error: reference to ‘next’ is ambiguous
answers/GD-S01640/color/color.cpp:18:9: error: reference to ‘next’ is ambiguous
answers/GD-S01640/color/color.cpp:19:18: error: reference to ‘next’ is ambiguous
answers/GD-S01898/arena/arena.cpp:112:3: error: reference to ‘function’ is ambiguous
answers/GD-S02035/detect/detect.cpp:31:33: error: reference to ‘get’ is ambiguous
answers/GD-S02035/detect/detect.cpp:33:4: error: reference to ‘get’ is ambiguous
answers/GD-S02073/duel/duel.cpp:31:3: error: reference to ‘hash’ is ambiguous
answers/GD-S02073/duel/duel.cpp:46:9: error: reference to ‘hash’ is ambiguous
answers/GD-S02073/duel/duel.cpp:49:13: error: reference to ‘hash’ is ambiguous
answers/GD-S02073/duel/duel.cpp:49:28: error: reference to ‘hash’ is ambiguous
answers/GD-S02073/duel/duel.cpp:56:11: error: reference to ‘hash’ is ambiguous
answers/GD-S02073/duel/duel.cpp:60:7: error: reference to ‘hash’ is ambiguous
answers/GD-S02073/duel/duel.cpp:86:9: error: reference to ‘hash’ is ambiguous
answers/GD-S02314/arena/arena.cpp:37:12: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:38:10: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:48:8: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:49:6: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:49:17: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:52:13: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:53:6: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:53:17: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:57:6: error: reference to ‘rank’ is ambiguous
answers/GD-S02314/arena/arena.cpp:57:17: error: reference to ‘rank’ is ambiguous
answers/GD-S02784/detect/detect.cpp:43:14: error: reference to ‘next’ is ambiguous
answers/GD-S02784/detect/detect.cpp:69:25: error: reference to ‘next’ is ambiguous
answers/GD-S02784/detect/detect.cpp:74:25: error: reference to ‘next’ is ambiguous

啊啊啊!

max(long, long long) 惨案

answers/GD-S00229/detect/detect.cpp:75:60: error: no matching function for call to ‘max(long long int&, long int)’
   75 |     endd[p]=max(endd[p],lower_bound(test+1,test+1+m,d)-test);
      |                                                            ^

真该死啊!!!两个指针相减返回了 long int!!!这个在本机真的能过编,该死啊!!!

answers/GD-S00229/detect/detect.cpp:75:60: error: no matching function for call to ‘max(long long int&, long int)’
answers/GD-S00354/duel/duel.cpp:18:24: error: no matching function for call to ‘max(long long int, int)’
answers/GD-S00579/detect/detect.cpp:77:56: error: no matching function for call to ‘max(long long int&, long int)’
answers/GD-S00709/detect/detect.cpp:125:138: error: no matching function for call to ‘min(long long int, long int)’
answers/GD-S01048/duel/duel.cpp:21:21: error: no matching function for call to ‘min(int&)’
answers/GD-S01242/detect/detect.cpp:97:48: error: no matching function for call to ‘max(long long int&, long int)’
answers/GD-S01242/detect/detect.cpp:103:70: error: no matching function for call to ‘max(long long int&, long int)’
answers/GD-S01354/detect/detect.cpp:51:132: error: no matching function for call to ‘min(long long int, long int)’
answers/GD-S01906/duel/duel.cpp:16:68: error: no matching function for call to ‘max(long long int, long int)’
answers/GD-S02536/detect/detect.cpp:98:75: error: no matching function for call to ‘max(ll&, long int)’
answers/GD-S02635/duel/duel.cpp:27:27: error: no matching function for call to ‘max(int, long long int)’

怎么这么多啊!!!

无返回类型

answers/GD-S00230/detect/detect.cpp:9:12: error: ISO C++ forbids declaration of ‘st1’ with no type [-fpermissive]
answers/GD-S00834/detect/detect.cpp:12:18: error: ISO C++ forbids declaration of ‘check’ with no type [-fpermissive]
answers/GD-S00991/color/color.cpp:5:9: error: ISO C++ forbids declaration of ‘intmain’ with no type [-fpermissive]
answers/GD-S01039/duel/duel.cpp:3:29: error: ISO C++ forbids declaration of ‘cmp’ with no type [-fpermissive]
answers/GD-S01042/color/color.cpp:31:21: error: ISO C++ forbids declaration of ‘solver0’ with no type [-fpermissive]
answers/GD-S01468/color/color.cpp:18:29: error: ISO C++ forbids declaration of ‘writech’ with no type [-fpermissive]
answers/GD-S01468/detect/detect.cpp:18:29: error: ISO C++ forbids declaration of ‘writech’ with no type [-fpermissive]
answers/GD-S01468/duel/duel.cpp:18:29: error: ISO C++ forbids declaration of ‘writech’ with no type [-fpermissive]
answers/GD-S02229/duel/duel.cpp:9:46: error: ISO C++ forbids declaration of ‘operator<’ with no type [-fpermissive]
answers/GD-S02229/duel/duel.cpp:11:47: error: ISO C++ forbids declaration of ‘operator==’ with no type [-fpermissive]
answers/GD-S02789/detect/detect.cpp:9:13: error: ISO C++ forbids declaration of ‘car_object’ with no type [-fpermissive]
answers/GD-S03109/detect/detect.cpp:27:16: error: ISO C++ forbids declaration of ‘rs’ with no type [-fpermissive]
answers/GD-S03305/detect/detect.cpp:18:20: error: ISO C++ forbids declaration of ‘sqrt’ with no type [-fpermissive]

统一以 -fno-ms-extensions 解决。

头文件查找失败

answers/GD-S00070/arena/arena.cpp:1:9: fatal error: iostram: No such file or directory
answers/GD-S00070/color/color.cpp:1:9: fatal error: iostram: No such file or directory
answers/GD-S00203/duel/duel.cpp:2:9: fatal error: conio.h: No such file or directory
answers/GD-S00371/arena/arena.cpp:1:9: fatal error: bits/stdc++.h0: No such file or directory
answers/GD-S00840/arena/arena.cpp:1:9: fatal error: bit/stdc++.h: No such file or directory
answers/GD-S00840/color/color.cpp:1:9: fatal error: bit/stdc++.h: No such file or directory
answers/GD-S00840/detect/detect.cpp:1:9: fatal error: bit/stdc++.h: No such file or directory
answers/GD-S00840/duel/duel.cpp:1:9: fatal error: bit/stdc++.h: No such file or directory
answers/GD-S01193/arena/arena.cpp:1:10: fatal error: Bits/stdc++.h: No such file or directory
answers/GD-S01193/color/color.cpp:1:10: fatal error: Bits/stdc++.h: No such file or directory
answers/GD-S01193/detect/detect.cpp:1:10: fatal error: Bits/stdc++.h: No such file or directory
answers/GD-S01193/duel/duel.cpp:1:10: fatal error: Bits/stdc++.h: No such file or directory
answers/GD-S01459/arena/arena.cpp:1:9: fatal error: bitrs/stdc++.h: No such file or directory
answers/GD-S01515/arena/arena.cpp:1:9: fatal error: bist/stdc++.h: No such file or directory
answers/GD-S01701/detect/detect.cpp:1:10: fatal error: bits/https.h++: No such file or directory
answers/GD-S01825/arena/arena.cpp:3:9: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S01825/color/color.cpp:3:9: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S01825/detect/detect.cpp:3:9: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02001/arena/arena.cpp:2:9: fatal error: windows.h: No such file or directory
answers/GD-S02018/arena/arena.cpp:1:9: fatal error: dit/stdc++.h: No such file or directory
answers/GD-S02018/color/color.cpp:1:9: fatal error: dit/stdc++.h: No such file or directory
answers/GD-S02018/detect/detect.cpp:1:9: fatal error: dit/stdc++.h: No such file or directory
answers/GD-S02018/duel/duel.cpp:1:9: fatal error: dit/stdc++.h: No such file or directory
answers/GD-S02102/color/color.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02102/detect/detect.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02102/duel/duel.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02170/arena/arena.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02170/color/color.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02170/detect/detect.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02170/duel/duel.cpp:1:10: fatal error: bits\stdc++.h: No such file or directory
answers/GD-S02197/arena/arena.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02197/color/color.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02197/detect/detect.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02197/duel/duel.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02554/color/color.cpp:1:9: fatal error: ibts/stdc++.h: No such file or directory
answers/GD-S02656/color/color.cpp:1:10: fatal error: bits./stdc++.h: No such file or directory
answers/GD-S02693/arena/arena.cpp:1:10: fatal error: bits./stdc++.h: No such file or directory
answers/GD-S02693/color/color.cpp:1:10: fatal error: bits./stdc++.h: No such file or directory
answers/GD-S02693/detect/detect.cpp:1:10: fatal error: bits./stdc++.h: No such file or directory
answers/GD-S02693/duel/duel.cpp:1:10: fatal error: bits./stdc++.h: No such file or directory
answers/GD-S02864/color/color.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02864/detect/detect.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02864/duel/duel.cpp:1:9: fatal error: bits/stdc++.h : No such file or directory
answers/GD-S02866/arena/arena.cpp:2:9: fatal error: windows.h: No such file or directory
answers/GD-S02950/detect/detect.cpp:2:9: fatal error: bfd.h: No such file or directory
answers/GD-S03347/color/color.cpp:1:9: fatal error: bist/stdc++.h: No such file or directory
answers/GD-S03347/duel/duel.cpp:1:9: fatal error: bist/stdc++.h: No such file or directory
answers/GD-S03363/duel/duel.cpp:1:10: fatal error: bits/stdc++.H: No such file or directory
answers/GD-S03510/duel/duel.cpp:2:9: fatal error: windows.h: No such file or directory

百花齐放

自动补全

answers/GD-S00651/arena/arena.cpp:4:1: note: ‘memcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
answers/GD-S00897/arena/arena.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answers/GD-S00897/arena/arena.cpp:15:3: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answers/GD-S01094/duel/duel.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answers/GD-S01094/duel/duel.cpp:7:2: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answers/GD-S01189/duel/duel.cpp:3:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
answers/GD-S01923/duel/duel.cpp:4:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
answers/GD-S02150/arena/arena.cpp:1:1: note: ‘stdin’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
answers/GD-S02150/arena/arena.cpp:6:26: note: ‘stdout’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
answers/GD-S02343/duel/duel.cpp:3:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
answers/GD-S02343/duel/duel.cpp:30:2: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
answers/GD-S02534/duel/duel.cpp:4:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
answers/GD-S02858/detect/detect.cpp:5:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
answers/GD-S03041/color/color.cpp:6:1: note: ‘std::vector’ is defined in header ‘<vector>’; did you forget to ‘#include <vector>’?
answers/GD-S03432/color/color.cpp:1:1: note: ‘getchar’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
answers/GD-S03432/color/color.cpp:17:25: note: ‘stdin’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
answers/GD-S03432/color/color.cpp:18:26: note: ‘stdout’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
answers/GD-S03432/color/color.cpp:1:1: note: ‘std::cout’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
answers/GD-S03432/color/color.cpp:1:1: note: ‘std::endl’ is defined in header ‘<ostream>’; did you forget to ‘#include <ostream>’?

意思是以上同学的代码忘记引入了这些头文件,被某些编译器补全了。

也有一部分也是这种错法,但是报错比较隐晦,这里选择三个 sqrt、ceil、floor

answers/GD-S01539/detect/detect.cpp:42:9: error: ‘sqrt’ was not declared in this scope
   42 |     if (sqrt(v[i] * v[i] + 2 * a[i] * s) > V) {
answers/GD-S01539/detect/detect.cpp:72:10: error: ‘sqrt’ was not declared in this scope
   72 |      if (sqrt(v[i] * v[i] + 2 * a[i] * s) > V) {
   18 |    if(sqrt(v*v+2*a*(a)))
   18 |    if(sqrt(v*v+2*a*(a)))
answers/GD-S03024/detect/detect.cpp:41:21: error: ‘sqrt’ was not declared in this scope
   41 |     long double tmp=sqrt(v[i]*v[i]+2*a[i]*(p[j]-d[i]));
answers/GD-S03024/detect/detect.cpp:69:20: error: ‘sqrt’ was not declared in this scope
   69 |    long double tmp=sqrt(v[i]*v[i]+2*a[i]*(p[j]-d[i]));
answers/GD-S03305/detect/detect.cpp:18:20: error: ISO C++ forbids declaration of ‘sqrt’ with no type [-fpermissive]
   18 |  inline sqrt(int _x){
answers/GD-S00731/detect/detect.cpp:33:25: error: ‘floor’ was not declared in this scope
   33 |   if (ndi) res.second = floor(nd);
answers/GD-S00731/detect/detect.cpp:35:21: error: ‘floor’ was not declared in this scope
   35 |   else res.second = floor(nd);
   51 |     l=lower_bound(p + 1, p + m + 1, d[i])-p,r=min((long long)m,lower_bound(p + 1, p + m + 1, d[i] + floor(max((double)0.0, t)))-p-1);
   51 |     l=lower_bound(p + 1, p + m + 1, d[i])-p,r=min((long long)m,lower_bound(p + 1, p + m + 1, d[i] + floor(max((double)0.0, t)))-p-1);
   51 |     l=lower_bound(p + 1, p + m + 1, d[i])-p,r=min((long long)m,lower_bound(p + 1, p + m + 1, d[i] + floor(max((double)0.0, t)))-p-1);
   51 |     l=lower_bound(p + 1, p + m + 1, d[i])-p,r=min((long long)m,lower_bound(p + 1, p + m + 1, d[i] + floor(max((double)0.0, t)))-p-1);
   51 |     l=lower_bound(p + 1, p + m + 1, d[i])-p,r=min((long long)m,lower_bound(p + 1, p + m + 1, d[i] + floor(max((double)0.0, t)))-p-1);
answers/GD-S01395/detect/detect.cpp:89:18: error: ‘floor’ was not declared in this scope
   89 |     if(S - 1.0 * floor(S) < eps)
answers/GD-S01395/detect/detect.cpp:105:18: error: ‘floor’ was not declared in this scope
  105 |     if(S - 1.0 * floor(S) < eps)
   11 |   k[i]=ceil(log2(c[i]));
answers/GD-S00731/detect/detect.cpp:30:24: error: ‘ceil’ was not declared in this scope
   30 |   if (sti) res.first = ceil(st);
answers/GD-S00731/detect/detect.cpp:32:20: error: ‘ceil’ was not declared in this scope
   32 |   else res.first = ceil(st);
answers/GD-S02441/detect/detect.cpp:29:43: error: ‘ceil’ was not declared in this scope
   29 |    q[i].r=is[i]?lower_bound(p+1,p+1+m,int(ceil((V-v[i])/2.0/a[i]))+d[i])-p-1:0;
answers/GD-S02758/detect/detect.cpp:48:18: error: ‘ceil’ was not declared in this scope
   48 |     rmax[i]=d[i]+ceil(v[i]*tim+0.5*a[i]*tim*tim);

找不到成员函数

answers/GD-S00002/duel/duel.cpp:13:6: error: request for member ‘sort’ in ‘num’, which is of non-class type ‘int [n]’
answers/GD-S00292/detect/detect.cpp:74:15: error: request for member ‘push_back’ in ‘t[(j ++)].tes::p’, which is of non-class type ‘int’
answers/GD-S00960/duel/duel.cpp:12:4: error: request for member ‘sort’ in ‘t’, which is of non-class type ‘int [10001][10001]’
answers/GD-S00981/detect/detect.cpp:84:13: error: request for member ‘empty’ in ‘p[v]’, which is of non-class type ‘int’
answers/GD-S00981/detect/detect.cpp:85:17: error: request for member ‘empty’ in ‘p[v]’, which is of non-class type ‘int’
answers/GD-S00981/detect/detect.cpp:86:17: error: request for member ‘top’ in ‘p[v]’, which is of non-class type ‘int’
answers/GD-S00981/detect/detect.cpp:88:15: error: request for member ‘top’ in ‘p[v]’, which is of non-class type ‘int’
answers/GD-S00981/detect/detect.cpp:90:11: error: request for member ‘pop’ in ‘p[v]’, which is of non-class type ‘int’
answers/GD-S01206/detect/detect.cpp:31:57: error: request for member ‘clear’ in ‘cnt1.std::vector<int>::operator[](((std::vector<int>::size_type)i))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02120/detect/detect.cpp:100:11: error: request for member ‘push_back’ in ‘t’, which is of non-class type ‘std::vector<int> [1000005]’
answers/GD-S02392/color/color.cpp:23:25: error: request for member ‘stdin’ in ‘"r"’, which is of non-class type ‘const char [2]’
answers/GD-S02769/detect/detect.cpp:42:10: error: request for member ‘push_back’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)k))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02769/detect/detect.cpp:48:26: error: request for member ‘size’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)ce1))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02769/detect/detect.cpp:50:15: error: request for member ‘f’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)ce2))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02769/detect/detect.cpp:50:36: error: request for member ‘end’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)ce2))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02769/detect/detect.cpp:54:27: error: request for member ‘size’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)ce2))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02769/detect/detect.cpp:56:15: error: request for member ‘f’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)ce1))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02769/detect/detect.cpp:56:36: error: request for member ‘end’ in ‘w.std::vector<int>::operator[](((std::vector<int>::size_type)ce1))’, which is of non-class type ‘__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type’ {aka ‘int’}
answers/GD-S02861/detect/detect.cpp:20:19: error: request for member ‘flag’ in ‘i’, which is of non-class type ‘int’
answers/GD-S03015/detect/detect.cpp:55:8: error: request for member ‘l_ct’ in ‘C’, which is of non-class type ‘car [100050]’
answers/GD-S03015/detect/detect.cpp:55:26: error: request for member ‘r_ct’ in ‘C’, which is of non-class type ‘car [100050]’
answers/GD-S03115/color/color.cpp:16:8: error: request for member ‘flag’ in ‘a[i]’, which is of non-class type ‘int’

有一部分是典型 python 玩家

answers/GD-S00002/duel/duel.cpp: In function ‘int main()’:
answers/GD-S00002/duel/duel.cpp:13:13: error: request for member ‘sort’ in ‘num’, which is of non-class type ‘int [n]’
   13 |         num.sort(0,n);
      |             ^~~~

还有一部分是没写完的,喷不了。

没有分号(分号被删除)

answers/GD-S00111/detect/detect.cpp:11:1: error: expected initializer before ‘double’
answers/GD-S00203/detect/detect.cpp:1:12: error: expected initializer before ‘WinMain’
answers/GD-S00265/arena/arena.cpp:5:1: error: expected initializer before ‘int’
answers/GD-S00981/arena/arena.cpp:5:1: error: expected initializer before ‘int’
answers/GD-S01188/color/color.cpp:16:3: error: expected initializer before ‘for’
answers/GD-S02137/detect/detect.cpp:16:5: error: expected initializer before ‘car’
answers/GD-S02159/color/color.cpp:7:2: error: expected initializer before ‘int’
answers/GD-S02221/detect/detect.cpp:63:13: error: expected initializer before ‘+=’ token
answers/GD-S02280/detect/detect.cpp:5:2: error: expected initializer before ‘int’
answers/GD-S02392/detect/detect.cpp:24:1: error: expected initializer before ‘int’
answers/GD-S03393/color/color.cpp:4:12: error: expected initializer before ‘long’

出现这个错误一般就是前一行没有分号。

freopen 的一百种错法

    4 |  freopen("road.in","r",strin);
    5 |  freopen("road.out","w",strout);
    4 |  freopen("road.in","r",strin);
    5 |  freopen("road.out","w",strout);
    4 |  freopen("road.in","r",strin);
    5 |  freopen("road.out","w",strout);
   22 |  freopen("road.in","r",strin);
   23 |  freopen("road.out","w",strout);
    4 |  freopen("duel.in","r",std);
    5 |  freopen("duel.out","w",std);
    6 |  freopen("color.out","w",stdout)
    5 |  freopen ("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen ("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen ("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen ("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen ("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen ("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    9 |  freopen("duel.out",w,stdout);
answers/GD-S00442/arena/arena.cpp:4:2: error: ‘feopen’ was not declared in this scope; did you mean ‘fdopen’?
    4 |  feopen("arena.in","r",stdin);
      |  fdopen
answers/GD-S00442/color/color.cpp:4:2: error: ‘feopen’ was not declared in this scope; did you mean ‘fdopen’?
    4 |  feopen("color.in","r",stdin);
      |  fdopen
answers/GD-S00442/detect/detect.cpp:4:2: error: ‘feopen’ was not declared in this scope; did you mean ‘fdopen’?
    4 |  feopen("detect.in","r",stdin);
      |  fdopen
answers/GD-S00442/duel/duel.cpp:4:2: error: ‘feopen’ was not declared in this scope; did you mean ‘fdopen’?
    4 |  feopen("duel.in","r",stdin);
      |  fdopen
answers/GD-S00505/duel/duel.cpp:9:2: error: invalid preprocessing directive #freopen
    9 | #freopen("duel.in","r",stdin);
answers/GD-S00505/duel/duel.cpp:10:2: error: invalid preprocessing directive #freopen
   10 | #freopen("duel.out","w",stdout);
answers/GD-S00643/color/color.cpp:25:2: error: ‘freoprn’ was not declared in this scope; did you mean ‘freopen’?
      |  freopen
   19 |  freopen("arena.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   20 |  freopen("arena.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   24 |  freopen("color.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   25 |  freopen("color.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |  freopen("detect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   11 |  freopen("detect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   11 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("color.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("color.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("detect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    8 |  freopen("detect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen("detect.out","w",stdout)
    9 |  in.open("color.in");
   10 |  out.open("color.out");
    5 |  freopen(stdin,'w',"detect1.in");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
    6 |  freopen(stdout,'t',"detect1.ans");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
    5 |  freopen(stdin,'w',"detect1.in");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
    6 |  freopen(stdout,'t',"detect1.ans");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
    7 |  freopen(stdin,'w',"detect1.in");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
    8 |  freopen(stdout,'t',"detect1.ans");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
    9 |  freopen(stdin,'w',"detect1.in");
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
   10 |  freopen(stdout,'t',"detect1.ans");s
/usr/include/stdio.h:252:46: note:   initializing argument 1 of ‘FILE* freopen(const char*, const char*, FILE*)’
  252 | extern FILE *freopen (const char *__restrict __filename,
   10 |  freopen(stdout,'t',"detect1.ans");s
   16 |     freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   17 |     freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   23 |     freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   24 |     freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   16 |     freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   17 |     freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   15 |     freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   16 |     freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    4 |  freopen("color.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen("color.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    4 |  freopen("dect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen("dect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   20 |  freopen(detect.in,"r",stdin);
   20 |  freopen(duel.in,"r",stdin);
    4 | freopen("detect.in","r",stdin);
    5 | freopen("detect.out","w",stdout);
    4 | freopen("duel.in","r",stdin);
    5 | freopen("duel.out","w",stdout);
    5 |  freopen("color.out","w",stout);
    5 |  freopen("detrct.out","w",stout);
answers/GD-S01267/color/color.cpp:4:31: error: expected ‘;’ before ‘freopen’
    4 |  freopen("color.in","r",stdin)
    5 |  freopen("color.out","w",stdout)
answers/GD-S01267/detect/detect.cpp:25:29: error: expected ‘;’ before ‘freopen’
   25 |  freopen("detect","r",stdin)
   26 |  freopen("detect.out","w",stdout)
answers/GD-S01267/duel/duel.cpp:6:30: error: expected ‘;’ before ‘freopen’
    6 |  freopen("duel.in","r",stdin)
    7 |  freopen("duel.out","w",stdout)
   11 |  freopen("detect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   12 |  freopen("detect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   12 |  freopen("color.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   13 |  freopen("color.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   11 |  freopen("detect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   12 |  freopen("detect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   11 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   12 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
answers/GD-S01414/color/color.cpp:17:2: error: ‘freopem’ was not declared in this scope; did you mean ‘freopen’?
      |  freopen
    6 |  freopen("","r",)
   10 |  freopen("duel.out","w",strout);
    4 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
answers/GD-S01664/arena/arena.cpp:5:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    5 |  preopen("arena.in","r",stdin);
      |  freopen
answers/GD-S01664/color/color.cpp:5:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    5 |  preopen("color.in","r",stdin);
      |  freopen
answers/GD-S01664/detect/detect.cpp:5:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    5 |  preopen("detect.in","r",stdin);
      |  freopen
answers/GD-S01664/duel/duel.cpp:5:5: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    5 |     preopen("duel.in","r",stdin);
      |     freopen
   16 |  freopen("duel.in",in,);
   16 |  freopen("duel.in",in,);
   17 |  freopen("duel.out",out,);
   17 |  freopen("duel.out",out,);
    6 |  freopen("arena.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("arena.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("color.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("color.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   23 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   24 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 |  freopen("arena.in","r",stdin);
answers/GD-S02150/arena/arena.cpp:5:2: error: ‘freopen’ was not declared in this scope
    5 |  freopen("arena.in","r",stdin);
    6 |  freopen("arena.out","w",stdout);
    4 |  freopen(arena.in,"r",stdin);
    4 |  freopen(color.in,"r",stdin);
    4 |  freopen(detect.in,"r",stdin);
   10 |  freopen(duel.in,"r",stdin);
answers/GD-S02207/detect/detect.cpp:5:32: error: expected ‘;’ before ‘freopen’
    5 |  freopen("detect.in","r",stdin)
    6 |  freopen("detect.out","w",stdout)
    5 |  freopen("color.out","w",stdout)
   16 |  freopen("detect.out,"w",stdout);
   16 |  freopen("detect.out,"w",stdout);
    8 |  freopen("detect.in","r",sidin);
    9 |  freopen("detect.out","w",sidout);
   23 |  freopen("color.in","r".stdin);
    2 | freopen("arena.in""r", stdin);
    3 | freopen("arena.out""w", stdout);
    2 | freopen("color.in""r", stdin);
    3 | freopen("color.out""w", stdout);
    2 | freopen("detect.in""r", stdin);
    3 | freopen("detect.out""w", stdout);
    2 | freopen("duel.in""r",stdin);
    3 | freopen("duel.out""w",stdout);
answers/GD-S02509/arena/arena.cpp:6:24: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("arena.in","r");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/arena/arena.cpp:7:25: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("arena.out","w");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/color/color.cpp:18:24: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
   18 |  freopen("color.in","r");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/color/color.cpp:19:25: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
   19 |  freopen("color.out","w");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/detect/detect.cpp:6:25: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("detect.in","r");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/detect/detect.cpp:7:26: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("detect.out","w");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/duel/duel.cpp:6:23: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.in","r");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02509/duel/duel.cpp:7:24: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("duel.out","w");
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02577/arena/arena.cpp:4:3: error: ‘freopen’ was not declared in this scope
    4 |   freopen("duel","r")
answers/GD-S02577/color/color.cpp:4:3: error: ‘freopen’ was not declared in this scope
    4 |   freopen("duel","r")
answers/GD-S02577/detect/detect.cpp:4:3: error: ‘freopen’ was not declared in this scope
    4 |   freopen("duel","r")
answers/GD-S02577/duel/duel.cpp:4:3: error: ‘freopen’ was not declared in this scope
    4 |   freopen("duel","r")
answers/GD-S02605/color/color.cpp:3:1: error: ‘freeopen’ does not name a type; did you mean ‘freopen’?
    3 | freeopen.in(color.in);
      | freopen
answers/GD-S02605/color/color.cpp:4:1: error: ‘freeopen’ does not name a type; did you mean ‘freopen’?
    4 | freeopen.out(color.ans);
      | freopen
answers/GD-S02605/detect/detect.cpp:4:1: error: ‘freeopen’ does not name a type; did you mean ‘freopen’?
    4 | freeopen.in(detect.in);
      | freopen
answers/GD-S02605/detect/detect.cpp:5:1: error: ‘freeopen’ does not name a type; did you mean ‘freopen’?
    5 | freeopen.out(detect.ans);
      | freopen
answers/GD-S02605/duel/duel.cpp:5:1: error: ‘freeopen’ does not name a type; did you mean ‘freopen’?
    5 | freeopen.in(detect.in);
      | freopen
answers/GD-S02605/duel/duel.cpp:6:1: error: ‘freeopen’ does not name a type; did you mean ‘freopen’?
    6 | freeopen.out(detect.ans);
      | freopen
    6 |  freopen ("arena.in",r,stdin);
    7 |  freopen ("arena.out",w,stdout);
   18 |  freopen ("color.in",r,stdin);
   19 |  freopen ("color.out",w,stdout);
   11 |  freopen ("detect.in",r,stdin);
   12 |  freopen ("detect.out",w,stdout);
    9 |  freopen ("duel.in",r,stdin);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |  freopen ("duel.out",w,stdout);
answers/GD-S02765/arena/arena.cpp:4:19: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    4 |  freopen("duel in")
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02765/arena/arena.cpp:5:2: error: expected ‘}’ before ‘freopen’
    5 |  freopen("duel out")
answers/GD-S02765/color/color.cpp:4:19: error: too few arguments to function ‘FILE* freopen(const char*, const char*, FILE*)’
    4 |  freopen("duel in")
  252 | extern FILE *freopen (const char *__restrict __filename,
answers/GD-S02765/color/color.cpp:5:2: error: expected ‘}’ before ‘freopen’
    5 |  freopen("duel out")
answers/GD-S02765/detect/detect.cpp:4:2: error: ‘frepon’ was not declared in this scope; did you mean ‘freopen’?
      |  freopen
   10 |  freopen("color.out","w",stdiout);
    6 |  freopen("detect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("detect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    4 |  freopen("color.in", r, stdin);
    5 |  freopen("color.ans", w, stdout);
    4 |  freopen("detect.in", r, stdin);
    5 |  freopen("detect.ans", w, stdout);
   20 |  freopen("duel.in", r, stdin);
   21 |  freopen("duel.ans", w, stdout);
answers/GD-S03099/arena/arena.cpp:5:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    5 |  preopen("arena.in","r",stdin);
      |  freopen
answers/GD-S03099/color/color.cpp:6:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    6 |  preopen("color.in","r",stdin);
      |  freopen
answers/GD-S03099/detect/detect.cpp:7:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    7 |  preopen("detect.in","r",stdin);
      |  freopen
answers/GD-S03099/duel/duel.cpp:6:2: error: ‘preopen’ was not declared in this scope; did you mean ‘freopen’?
    6 |  preopen("dule.in","r",stdin);
      |  freopen
   17 |  freopen("color.in","r",stdin);
answers/GD-S03432/color/color.cpp:17:2: error: ‘freopen’ was not declared in this scope
   17 |  freopen("color.in","r",stdin);
   18 |  freopen("color.out","w",stdout);
    9 |  freopen("arena.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |  freopen("arena.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    9 |  freopen("color.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |  freopen("color.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |     freopen("detect.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   11 |  freopen("detect.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   10 |  freopen("duel.in","r","stdin");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
   11 |  freopen("duel.out","w","stdout");
/usr/include/stdio.h:254:26: note:   initializing argument 3 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.in",stdin);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("duel.in",stdout);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.in",stdin);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("duel.in",stdout);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
    6 |  freopen("duel.in",stdin);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
    7 |  freopen("duel.in",stdout);
/usr/include/stdio.h:253:32: note:   initializing argument 2 of ‘FILE* freopen(const char*, const char*, FILE*)’
    5 | n\ freopen("color.out","w",stdout);
    5 | n\ freopen("color.out","w",stdout);

以上是搜寻字符串 open 搜到的,有一些的错误信息没显示出来,就看个数量级就好。

但是有个漏网之鱼使我大受震撼:

answers/GD-S00377/color/color.cpp: In function ‘int main()’:
answers/GD-S00377/color/color.cpp:6:24: error: ‘in’ was not declared in this scope; did you mean ‘n’?
    6 |  printf("color.in","r",in);
      |                        ^~
      |                        n
answers/GD-S00377/color/color.cpp:7:24: error: ‘out’ was not declared in this scope
    7 |  scanf("color.out","w",out);
      |                        ^~~

恍然大悟,我终于会重定向文件输入输出了!

不知所云的 include

answers/GD-S00434/arena/arena.cpp:1:2: error: invalid preprocessing directive #inculde; did you mean #include?
answers/GD-S00505/duel/duel.cpp:9:2: error: invalid preprocessing directive #freopen
answers/GD-S00505/duel/duel.cpp:10:2: error: invalid preprocessing directive #freopen
answers/GD-S00897/arena/arena.cpp:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
answers/GD-S00991/color/color.cpp:3:2: error: invalid preprocessing directive #definescscore
answers/GD-S01094/arena/arena.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
answers/GD-S01094/color/color.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
answers/GD-S01094/detect/detect.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
answers/GD-S01094/duel/duel.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
answers/GD-S02150/arena/arena.cpp:1:2: error: invalid preprocessing directive #incldue; did you mean #include?
answers/GD-S02696/arena/arena.cpp:1:2: error: invalid preprocessing directive #inlcude; did you mean #include?
answers/GD-S02785/arena/arena.cpp:1:2: error: invalid preprocessing directive #intrsrpeast
answers/GD-S02785/color/color.cpp:1:2: error: invalid preprocessing directive #intrsrpeast
answers/GD-S02785/detect/detect.cpp:1:2: error: invalid preprocessing directive #intrsrpeast
answers/GD-S02785/duel/duel.cpp:1:2: error: invalid preprocessing directive #intrsrpeast
answers/GD-S03432/color/color.cpp:1:2: error: invalid preprocessing directive #incldue; did you mean #include?

did you mean #include?

杂项

answers/GD-S00002/duel/duel.cpp: In function ‘int main()’:
answers/GD-S00002/duel/duel.cpp:13:13: error: request for member ‘sort’ in ‘num’, which is of non-class type ‘int [n]’
   13 |         num.sort(0,n);
      |             ^~~~

典型 python 玩家

answers/GD-S00203/arena/arena.cpp:4:7: error: expected identifier before ‘*’ token
    4 | class *|* {
      |       ^
answers/GD-S00203/arena/arena.cpp:4:8: error: expected unqualified-id before ‘|’ token
    4 | class *|* {
      |        ^
complie: answers/GD-S00203/color/color.cpp
answers/GD-S00203/color/color.cpp:1:1: error: ‘LRESULT’ does not name a type
    1 | LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) {
      | ^~~~~~~
complie: answers/GD-S00203/detect/detect.cpp
answers/GD-S00203/detect/detect.cpp:1:12: error: expected initializer before ‘WinMain’
    1 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
      |            ^~~~~~~
complie: answers/GD-S00203/duel/duel.cpp
answers/GD-S00203/duel/duel.cpp:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.

你参加的是什么考试啊

$ view answers/GD-S01048/duel/duel.cpp
#include<bits/stdc++.h>
using namespace std;



const int N = 10010;
int n,r[N]=0,c[N]=0,s[N]=0;
int m=0;

void (int a,int b){

}

int main(){
    freopen("duel.in","r","stdin");
    freopen("duel.out","w","stdout");
    cin>> n;
    for(int i = 0;i<=n;i++){
        cin >> r[i];}
    for(int i = 0;i<=n;i++){
        m = min(r[i]);

        c[i] = m;
    }
    for(int i = 0;i<=n;i++){
        m = r[0];
        if(r[i]>m) {m=r[i]}

        c[i] = m;
    }
    if(n==5&&r=[1,2,3,2,1]) cout<<2;
    fclose("duel.in");
    fclose("duel.out");
    return 0;}

这位不知道写的是什么语言

cc1plus: error: ‘::main’ must return ‘int’

翻了发现是 #define int long long 然后 int main(具体哪位选手忘了)

answers/GD-S01683/detect/detect.cpp:31:49: error: invalid type argument of unary ‘*’ (have ‘int’)
   31 |      D[i].x+=D[i].v*timeout+0.5*D[i].a*timeout**2;
      |                                                 ^

\(timeout^2\)

answers/GD-S01224/color/color.cpp:42:1: error: ‘f’ does not name a type
   42 | f**k you ccf
      | ^

精神状态良好

posted @ 2024-11-05 09:09  caijianhong  阅读(273)  评论(1编辑  收藏  举报