#1672
Civilizatie
t
ani, dacă nu ar întâlni nici un alt oraş şi nici nu ar ajunge la marginea hărţii.N
oraşe şi-au încetat extinderea, începută din cartierele iniţiale ale căror coordonate se citesc din fişier, şi aria suprafeţei din hartă rămasă neocupată, exprimată în hectare.Problema | Civilizatie | Operații I/O |
civilizatie.in /civilizatie.out
|
---|---|---|---|
Limita timp | 1.5 secunde | Limita memorie |
Total: 128 MB
/
Stivă 8 MB
|
Id soluție | #2742927 | Utilizator | |
Fișier | civilizatie.cpp | Dimensiune | 2.09 KB |
Data încărcării | 14 August 2016, 11:33 | Scor / rezultat | Eroare de compilare |
civilizatie.cpp:21:15: error: 'int time' redeclared as different kind of symbol int N,M, i,j, time, n, brexit[maxN], cerinta, nr; ^ In file included from /usr/include/pthread.h:24:0, from /usr/include/i386-linux-gnu/c++/4.8/bits/gthr-default.h:35, from /usr/include/i386-linux-gnu/c++/4.8/bits/gthr.h:148, from /usr/include/c++/4.8/ext/atomicity.h:35, from /usr/include/c++/4.8/bits/basic_string.h:39, from /usr/include/c++/4.8/string:52, from /usr/include/c++/4.8/random:41, from /usr/include/c++/4.8/bits/stl_algo.h:65, from /usr/include/c++/4.8/algorithm:62, from civilizatie.cpp:2: /usr/include/time.h:192:15: error: previous declaration of 'time_t time(time_t*)' extern time_t time (time_t *__timer) __THROW; ^ civilizatie.cpp: In function 'int main()': civilizatie.cpp:72:13: error: assignment of function 'time_t time(time_t*)' for(time=0; nr && time<maxTime; ++time) ^ civilizatie.cpp:72:13: error: cannot convert 'int' to 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' in assignment civilizatie.cpp:72:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(time=0; nr && time<maxTime; ++time) ^ civilizatie.cpp:72:39: error: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' [-fpermissive] for(time=0; nr && time<maxTime; ++time) ^ civilizatie.cpp:72:39: error: lvalue required as increment operand civilizatie.cpp:76:28: error: invalid types 'std::vector<std::pair<int, int> > [99999][time_t(time_t*)throw () {aka long int(long int*)throw ()}]' for array subscript for(it = event[time].begin(); it != event[time].end(); ++it) ^ civilizatie.cpp:76:55: error: invalid types 'std::vector<std::pair<int, int> > [99999][time_t(time_t*)throw () {aka long int(long int*)throw ()}]' for array subscript for(it = event[time].begin(); it != event[time].end(); ++it) ^ civilizatie.cpp:77:75: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if( brexit[it->first]==-1 && time == Add(it->first, it->second) ) ^ civilizatie.cpp:83:30: error: invalid conversion from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' [-fpermissive] brexit[*iit] = time; ^ civilizatie.cpp:91:10: error: assignment of function 'time_t time(time_t*)' time = 0; ^ civilizatie.cpp:91:10: error: cannot convert 'int' to 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' in assignment civilizatie.cpp:94:59: error: no matching function for call to 'max(time_t (&)(time_t*)throw (), int&)' ans -= Arie[brexit[i]], time = max(time, brexit[i]); ^ civilizatie.cpp:94:59: note: candidates are: In file included from /usr/include/c++/4.8/algorithm:61:0, from civilizatie.cpp:2: /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template<class _Tp> const _Tp& std::max(const _Tp&, const _Tp&) max(const _Tp& __a, const _Tp& __b) ^ /usr/include/c++/4.8/bits/stl_algobase.h:216:5: note: template argument deduction/substitution failed: civilizatie.cpp:94:59: note: deduced conflicting types for parameter 'const _Tp' ('long int(long int*)throw ()' and 'int') ans -= Arie[brexit[i]], time = max(time, brexit[i]); ^ In file included from /usr/include/c++/4.8/algorithm:61:0, from civilizatie.cpp:2: /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template<class _Tp, class _Compare> const _Tp& std::max(const _Tp&, const _Tp&, _Compare) max(const _Tp& __a, const _Tp& __b, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algobase.h:260:5: note: template argument deduction/substitution failed: civilizatie.cpp:94:59: note: deduced conflicting types for parameter 'const _Tp' ('long int(long int*)throw ()' and 'int') ans -= Arie[brexit[i]], time = max(time, brexit[i]); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from civilizatie.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template<class _Tp> _Tp std::max(std::initializer_list<_Tp>) max(initializer_list<_Tp> __l) ^ /usr/include/c++/4.8/bits/stl_algo.h:4231:5: note: template argument deduction/substitution failed: civilizatie.cpp:94:59: note: mismatched types 'std::initializer_list<_Tp>' and 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' ans -= Arie[brexit[i]], time = max(time, brexit[i]); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from civilizatie.cpp:2: /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template<class _Tp, class _Compare> _Tp std::max(std::initializer_list<_Tp>, _Compare) max(initializer_list<_Tp> __l, _Compare __comp) ^ /usr/include/c++/4.8/bits/stl_algo.h:4236:5: note: template argument deduction/substitution failed: civilizatie.cpp:94:59: note: mismatched types 'std::initializer_list<_Tp>' and 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' ans -= Arie[brexit[i]], time = max(time, brexit[i]); ^ civilizatie.cpp:96:36: warning: pointer to a function used in arithmetic [-Wpointer-arith] printf("%llu\n%d\n", ans, time+1); ^ civilizatie.cpp:96:37: warning: format '%d' expects argument of type 'int', but argument 3 has type 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' [-Wformat=] printf("%llu\n%d\n", ans, time+1); ^ civilizatie.cpp:43:42: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("civilizatie.in", "r", stdin); ^ civilizatie.cpp:44:44: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("civilizatie.out", "w", stdout); ^ civilizatie.cpp:46:38: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d", &cerinta, &N, &M); ^ civilizatie.cpp:54:24: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &n); ^ civilizatie.cpp:58:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d", &n, &n); ^ civilizatie.cpp:62:40: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d", &a[i].x, &a[i].y); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Civilizatie face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
Suma punctajelor acordate pe testele utilizate pentru verificare este 100. Astfel, soluția ta poate obține cel mult 100 de puncte, caz în care se poate considera corectă.