#1739
Proiecte1
În oraşul Iaşi, cele N
firme IT derulează în prezent M
proiecte din acest domeniu (printre care şi ONI 2012). Firmele sunt identificate prin numere naturale de la 1
la N
, iar proiectele sunt identificate prin numere naturale de la 1
la M
. Fiecare proiect are una sau mai multe etape, o etapă fiind executată de o singură firmă IT. Spunem că o firmă coordonează un proiect dacă execută mai mult de jumătate din etapele proiectului.
Cunoscând numărul firmelor IT, numărul proiectelor, numărul de etape ale fiecărui proiect şi firmele ce execută fiecare etapă, să se determine firma/firmele care coordonează cel mai mare număr de proiecte.
ONI 2012, Clasa a VII-a
Problema | Proiecte1 | Operații I/O |
proiecte.in /proiecte.out
|
---|---|---|---|
Limita timp | 0.2 secunde | Limita memorie |
Total: 1 MB
/
Stivă 1 MB
|
Id soluție | #4325025 | Utilizator | |
Fișier | proiecte1.cpp | Dimensiune | 526 B |
Data încărcării | 15 Februarie 2017, 15:55 | Scor / rezultat | Eroare de compilare |
proiecte1.cpp:3:1: error: expected initializer before 'unsigned' unsigned char v[1 000 001]; ^ proiecte1.cpp: In function 'int main()': proiecte1.cpp:8:9: error: expected ';' before 'f' freopen f("proiecte.in","r",stdin); ^ proiecte1.cpp:8:35: warning: statement is a reference, not call, to function 'freopen' [-Waddress] freopen f("proiecte.in","r",stdin); ^ proiecte1.cpp:8:35: warning: statement has no effect [-Wunused-value] proiecte1.cpp:9:9: error: expected ';' before 'g' freopen g("proiecte.out","w",stdout); ^ proiecte1.cpp:9:37: warning: statement is a reference, not call, to function 'freopen' [-Waddress] freopen g("proiecte.out","w",stdout); ^ proiecte1.cpp:9:37: warning: statement has no effect [-Wunused-value] proiecte1.cpp:10:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=] scanf("%d%d",&n,&m); ^ proiecte1.cpp:10:19: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long unsigned int*' [-Wformat=] proiecte1.cpp:13:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=] scanf("%d",&nr); ^ proiecte1.cpp:14:9: error: 'j' was not declared in this scope for(j = 1;j <= nr;j ++) ^ proiecte1.cpp:15:18: error: 'x' was not declared in this scope {scanf("%d",&x); ^ proiecte1.cpp:16:1: error: 'f' was not declared in this scope f >> n>> m; ^ proiecte1.cpp:18:7: error: 'r' was not declared in this scope {f >> r; ^ proiecte1.cpp:21:12: error: 'c' was not declared in this scope if(nr == 0)c = x,nr = 1; ^ proiecte1.cpp:22:14: error: 'c' was not declared in this scope else if(x == c)nr++; ^ proiecte1.cpp:25:1: error: 'v' was not declared in this scope v[c]++; ^ proiecte1.cpp:25:3: error: 'c' was not declared in this scope v[c]++; ^ proiecte1.cpp:30:5: error: expected primary-expression before 'return' return 0; ^ proiecte1.cpp:30:5: error: expected ';' before 'return' proiecte1.cpp:30:5: error: expected primary-expression before 'return' proiecte1.cpp:30:5: error: expected ')' before 'return' proiecte1.cpp:31:1: error: expected '}' at end of input } ^ proiecte1.cpp:31:1: error: expected '}' at end of input proiecte1.cpp:10:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d",&n,&m); ^ proiecte1.cpp:13:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&nr); ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Proiecte1 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ă.