#1753
Concurs2
La un concurs de programare s-au înscris n
elevi. Concursul se desfăşoară pe două secţiuni, secţiunea 1
pentru începători şi secţiunea 2
avansaţi. Proba de concurs se desfăşoară pe parcursul a 3
ore şi elevii au de rezolvat 2
probleme.
Fiecare problemă poate avea punctajul minim de 0
puncte şi punctajul maxim de 100
de puncte. Punctajul final al concurentului este format din suma punctajelor celor două probleme. Să se scrie un program care citeşte numărul de elevi înscrişi şi apoi date despre fiecare elev înscris (secţiunea la care s-a înscris, punctajul obţinut pentru prima problema şi punctajul obţinut pentru a două problemă) și rezolvă următoarele cerinţe:
1. Afișează mesajul DA
dacă toţi cei N
elevi înscrişi au reuşit să obţină un punctaj nenul la ambele probleme propuse, respectiv NU
” în caz contrar.
2. Afişează pentru fiecare secţiune numărul de elevi înscrişi. Afişarea se va face în ordinea crescătoare a numărului secţiunii, prin perechi de numere de forma nr_secţiune nr_elevi
.
3. Afişaţi pentru fiecare secţiune punctajul maxim obţinut şi numărul de elevi care au obţinut acest punctaj. Afişarea se va face în ordinea crescătoare a numărului secţiunii, prin triplete de numere de forma nr_secţiune punctaj_maxim nr_elevi
. Ştiind ca premiile se acordă doar celor care au luat punctaj maxim, afişaţi şi numărul de premii care vor fi acordate.
Concursul EMPOWERSOFT, 2016
Problema | Concurs2 | Operații I/O |
concurs2.in /concurs2.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 2 MB
/
Stivă 2 MB
|
Id soluție | #30041996 | Utilizator | |
Fișier | concurs2.cpp | Dimensiune | 1.63 KB |
Data încărcării | 08 Iunie 2021, 18:28 | Scor / rezultat | Eroare de compilare |
concurs2.cpp: In function 'int main()': concurs2.cpp:10:5: error: reference to 'cin' is ambiguous cin >> c >> n; ^ concurs2.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("concurs2.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ concurs2.cpp:17:13: error: reference to 'cin' is ambiguous cin >> a >> b >> c; ^ concurs2.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("concurs2.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ concurs2.cpp:22:13: error: reference to 'cout' is ambiguous cout << "DA"; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:24:13: error: reference to 'cout' is ambiguous cout << "NU"; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:32:13: error: reference to 'cin' is ambiguous cin >> a >> b >> c; ^ concurs2.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("concurs2.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ concurs2.cpp:38:9: error: reference to 'cout' is ambiguous cout << 1 << ' ' << cnt1; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:39:9: error: reference to 'cout' is ambiguous cout << endl; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:40:9: error: reference to 'cout' is ambiguous cout << 2 << ' ' << cnt2; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:49:13: error: reference to 'cin' is ambiguous cin >> a[i] >> b[i] >> c[i]; ^ concurs2.cpp:4:10: note: candidates are: std::ifstream cin ifstream cin("concurs2.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ concurs2.cpp:68:9: error: reference to 'cout' is ambiguous cout << 1 << ' ' << max1 << ' ' << cnt1 << endl; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:69:9: error: reference to 'cout' is ambiguous cout << 2 << ' ' << max2 << ' ' << cnt2 << endl; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ concurs2.cpp:70:9: error: reference to 'cout' is ambiguous cout << cnt1+cnt2; ^ concurs2.cpp:5:10: note: candidates are: std::ofstream cout ofstream cout("concurs2.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from concurs2.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Concurs2 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ă.