Borderou de evaluare (job #662886)
Utilizator |
|
IP | ascuns |
---|---|---|---|
Problemă | Competitie | Compilator | cpp-32 |
Rundă | Arhiva de probleme | Status | evaluat |
Dată | 19 sept. 2022 21:25:38 | Scor | 0 |
Raport evaluator
Eroare de compilare:
main.cpp:10:18: error: 'int time [1001]' redeclared as different kind of entity
10 | int time[1 + NMAX];
| ^
In file included from /usr/include/pthread.h:23,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/i686-pc-linux-gnu/bits/gthr-default.h:35,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/i686-pc-linux-gnu/bits/gthr.h:148,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/ext/atomicity.h:35,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/bits/ios_base.h:39,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/ios:42,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/istream:38,
from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/fstream:38,
from main.cpp:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
76 | extern time_t time (time_t *__timer) __THROW;
| ^~~~
main.cpp: In function 'int solve(int)':
main.cpp:27:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
27 | from += time[index] + (lap[index] % rest[index]);
| ^
main.cpp:27:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
27 | from += time[index] + (lap[index] % rest[index]);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:27:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
27 | from += time[index] + (lap[index] % rest[index]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:27:12: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*)'} to 'int' [-fpermissive]
27 | from += time[index] + (lap[index] % rest[index]);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| time_t (*)(time_t*) noexcept {aka long int (*)(long int*)}
main.cpp: In function 'int main()':
main.cpp:42:17: warning: pointer to a function used in arithmetic [-Wpointer-arith]
42 | in >> time[i] >> rest[i];
| ^
main.cpp:42:8: error: no match for 'operator>>' (operand types are 'std::ifstream' {aka 'std::basic_ifstream<char>'} and 'time_t(time_t*) noexcept' {aka 'long int(long int*)'})
42 | in >> time[i] >> rest[i];
| ~~ ^~ ~~~~~~~
| | |
| | time_t(time_t*) noexcept {aka long int(long int*)}
| std::ifstream {aka std::basic_ifstream<char>}
In file included from /usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/fstream:38,
from main.cpp:1:
/usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/istream:120:7: note: candidate: 'std::basic_istream<_CharT, _Traits>::__istream_type& std::basic_istream<_CharT, _Traits>::operator>>(std::basic_istream<_CharT, _Traits>::__istream_type& (*)(std::basic_istream<_CharT, _Traits>::__istream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::__istream_type = std::basic_istream<char>]' (near match)
120 | operator>>(__istream_type& (*__pf)(__istream_type&))
| ^~~~~~~~
/usr/lib/gcc/i686-pc-linux-gnu/11.3.0/include/g++-v11/istream:120:7: note: conversion of argument 1 would be ill-formed:
main.cpp:42:17: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*)'} to 'std::basic_istream<char>::__istream_type& (*)(std::basic_istream<char>::__istream_type&)' {aka 'std::basic_istream<char>& (*)(std::basic_istream<char>&)'} [-fpermissive]
42 | in >> time[i] >> rest[i];
| ~~~~~~^
| |