실행 실패 (제출 코드 컴파일 에러)
Main.cpp:5:18: error: ‘int select [100001]’ redeclared as different kind of entity 5 | int select[100001]; | ^ In file included from /usr/include/aarch64-linux-gnu/sys/types.h:179, from /usr/include/stdlib.h:395, from /usr/include/c++/11/bits/std_abs.h:38, from /usr/include/c++/11/cmath:47, from /usr/include/aarch64-linux-gnu/c++/11/bits/stdc++.h:41, from Main.cpp:2: /usr/include/aarch64-linux-gnu/sys/select.h:102:12: note: previous declaration ‘int select(int, fd_set*, fd_set*, fd_set*, timeval*)’ 102 | extern int select (int __nfds, fd_set *__restrict __readfds, | ^~~~~~ Main.cpp: In function ‘int main()’: Main.cpp:17:34: error: ISO C++ forbids applying ‘sizeof’ to an expression of function type [-fpermissive] 17 | memset(select, 0, sizeof(select)); | ~^~~~~~~ Main.cpp:17:16: error: invalid conversion from ‘int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)’ to ‘void*’ [-fpermissive] 17 | memset(select, 0, sizeof(select)); | ^~~~~~ | | | int (*)(int, fd_set*, fd_set*, fd_set*, timeval*) In file included from /usr/include/features.h:486, from /usr/include/aarch64-linux-gnu/c++/11/bits/os_defines.h:39, from /usr/include/aarch64-linux-gnu/c++/11/bits/c++config.h:586, from /usr/include/c++/11/cassert:43, from /usr/include/aarch64-linux-gnu/c++/11/bits/stdc++.h:33, from Main.cpp:2: /usr/include/aarch64-linux-gnu/bits/string_fortified.h:57:1: note: initializing argument 1 of ‘void* memset(void*, int, size_t)’ 57 | __NTH (memset (void *__dest, int __ch, size_t __len)) | ^~~~~ Main.cpp:26:21: warning: pointer to a function used in arithmetic [-Wpointer-arith] 26 | select[i] = k; | ^ Main.cpp:26:23: error: assignment of read-only location ‘*(select + ((sizetype)i))’ 26 | select[i] = k; | ~~~~~~~~~~^~~ Main.cpp:34:33: warning: pointer to a function used in arithmetic [-Wpointer-arith] 34 | int start = select[i]; | ^ Main.cpp:34:33: error: invalid conversion from ‘int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)’ to ‘int’ [-fpermissive] 34 | int start = select[i]; | ^ | | | int (*)(int, fd_set*, fd_set*, fd_set*, timeval*) Main.cpp:36:35: warning: pointer to a function used in arithmetic [-Wpointer-arith] 36 | int nxt = select[start]; | ^ Main.cpp:36:35: error: invalid conversion from ‘int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)’ to ‘int’ [-fpermissive] 36 | int nxt = select[start]; | ^ | | | int (*)(int, fd_set*, fd_set*, fd_set*, timeval*) Main.cpp:40:33: warning: pointer to a function used in arithmetic [-Wpointer-arith] 40 | nxt = select[nxt]; | ^ Main.cpp:40:33: error: invalid conversion from ‘int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)’ to ‘int’ [-fpermissive] 40 | nxt = select[nxt]; | ~~~~~~~~~~^ | | | int (*)(int, fd_set*, fd_set*, fd_set*, timeval*)
정답 개수:
-
틀린 개수:
-
실행 실패 개수:
-
비공개 코드입니다. 코드 작성자만 볼 수 있습니다.
반례를 발견하지 못했습니다.