#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 | #21613920 | Utilizator | |
Fișier | project_management.cpp | Dimensiune | 1.74 KB |
Data încărcării | 06 Martie 2020, 12:44 | Scor / rezultat | Eroare de compilare |
project_management.cpp:9:28: error: 'int time [101]' redeclared as different kind of symbol int a[101],x,y,n,m,time[101],start[101],topsort[101],q,maxim,fin[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/istream:38, from /usr/include/c++/4.8/fstream:38, 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 'void addToStack(int)': project_management.cpp:13:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0; i<v[x].size(); i++) ^ project_management.cpp: In function 'int main()': project_management.cpp:25:22: warning: pointer to a function used in arithmetic [-Wpointer-arith] f>>time[i]; ^ project_management.cpp:25:22: error: cannot bind 'std::basic_istream<char>' lvalue to 'std::basic_istream<char>&&' In file included from /usr/include/c++/4.8/fstream:38: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:51:36: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0; j < v[q].size(); j++) ^ project_management.cpp:53:69: warning: pointer to a function used in arithmetic [-Wpointer-arith] if(start[v[q][j]]==0 || start[v[q][j]] < start[q]+time[q]) ^ project_management.cpp:53:69: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:53:69: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] project_management.cpp:55:47: warning: pointer to a function used in arithmetic [-Wpointer-arith] start[v[q][j]]=start[q]+time[q]; ^ project_management.cpp:55:47: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:55:40: error: invalid conversion from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' [-fpermissive] start[v[q][j]]=start[q]+time[q]; ^ project_management.cpp:56:55: warning: pointer to a function used in arithmetic [-Wpointer-arith] if(maxim < start[v[q][j]]+time[v[q][j]]) ^ project_management.cpp:56:55: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:56:55: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] project_management.cpp:57:54: warning: pointer to a function used in arithmetic [-Wpointer-arith] maxim=start[v[q][j]]+time[v[q][j]]; ^ project_management.cpp:57:54: warning: pointer to a function used in arithmetic [-Wpointer-arith] project_management.cpp:57:41: error: invalid conversion from 'time_t (*)(time_t*)throw () {aka long int (*)(long int*)throw ()}' to 'int' [-fpermissive] maxim=start[v[q][j]]+time[v[q][j]]; ^ project_management.cpp:66:32: warning: pointer to a function used in arithmetic [-Wpointer-arith] fin[q]=maxim-time[q]; ^ project_management.cpp:66:32: error: invalid operands of types 'int' and 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to binary 'operator-' project_management.cpp:70:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0; j<v[q].size(); j++) ^ project_management.cpp:72:75: warning: pointer to a function used in arithmetic [-Wpointer-arith] if(fin[q]==-1 || (fin[q]!=-1 && fin[q]>fin[v[q][j]]-time[q])) ^ project_management.cpp:72:75: error: invalid operands of types 'int' and 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to binary 'operator-' project_management.cpp:73:47: warning: pointer to a function used in arithmetic [-Wpointer-arith] fin[q]=fin[v[q][j]]-time[q]; ^ project_management.cpp:73:47: error: invalid operands of types 'int' and 'time_t(time_t*)throw () {aka long int(long int*)throw ()}' to binary 'operator-'
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ă.