#1101
Project Management
La o firmă de software se lucrează la un mare proiect. Proiectul constă în executarea a n
(n
număr natural) faze de dezvoltare, numerotate cu numerele 1
, 2
, …, n
. Unele faze pot fi executate în paralel (în acelaşi timp), însă executarea altor faze nu poate fi începută până când nu se finalizează executarea anumitor faze.
Să se scrie un program care să se determine:
a) timpul minim t
în care se poate finaliza executarea proiectului
b) pentru fiecare fază k
(k
din {1,2,…,n}
), momentul de timp c
k
la care poate începe faza k
cel mai devreme, respectiv momentul de timp d
k
la care poate începe faza k
cel mai târziu, fără a influenţa durata totală de executare a proiectului.
OJI 2009, Clasele XI-XII
Problema | Project Management | Operații I/O |
pm.in /pm.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #8888274 | Utilizator | |
Fișier | project_management.cpp | Dimensiune | 1.04 KB |
Data încărcării | 16 Martie 2018, 22:01 | Scor / rezultat | Eroare de compilare |
project_management.cpp:11:13: error: 'int time [101]' redeclared as different kind of symbol int time[101]; ^ 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/ios_base.h:39, from /usr/include/c++/4.8/ios:42, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from project_management.cpp:1: /usr/include/time.h:192:15: error: previous declaration of 'time_t time(time_t*)' extern time_t time (time_t *__timer) __THROW; ^ project_management.cpp: In function 'int main()': project_management.cpp:22:39: warning: pointer to a function used in arithmetic [-Wpointer-arith] for(int i=0;i<n;i++) fin>>time[i+1]; ^ project_management.cpp:22:39: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:22:39: error: cannot bind 'std::basic_istream<char>' lvalue to 'std::basic_istream<char>&&' In file included from /usr/include/c++/4.8/iostream:40:0, from project_management.cpp:1: /usr/include/c++/4.8/istream:872:5: error: initializing argument 1 of 'std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = long int(long int*)throw ()]' operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x) ^ project_management.cpp:29:34: warning: pointer to a function used in arithmetic [-Wpointer-arith] sumtime[i+1]=time[i+1]; ^ project_management.cpp:29:34: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:29:34: error: invalid conversion from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' [-fpermissive] project_management.cpp:48:55: warning: pointer to a function used in arithmetic [-Wpointer-arith] sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^ project_management.cpp:48:55: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:48:68: warning: pointer to a function used in arithmetic [-Wpointer-arith] sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^ project_management.cpp:48:69: error: no matching function for call to 'max(int&, time_t (*)(time_t*)throw ())' sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^ project_management.cpp:48:69: note: candidates are: In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from project_management.cpp:1: /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: project_management.cpp:48:69: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}') sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^ In file included from /usr/include/c++/4.8/bits/char_traits.h:39:0, from /usr/include/c++/4.8/ios:40, from /usr/include/c++/4.8/ostream:38, from /usr/include/c++/4.8/iostream:39, from project_management.cpp:1: /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: project_management.cpp:48:69: note: deduced conflicting types for parameter 'const _Tp' ('int' and 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}') sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from project_management.cpp:4: /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: project_management.cpp:48:69: note: mismatched types 'std::initializer_list<_Tp>' and 'int' sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^ In file included from /usr/include/c++/4.8/algorithm:62:0, from project_management.cpp:4: /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: project_management.cpp:48:69: note: mismatched types 'std::initializer_list<_Tp>' and 'int' sumtime[i+1]=max(sumtime[i+1],time[i+1]+sumtime[nod]); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Project Management 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ă.