#3397
gard2
Mihăiță s-a hotărât să își construiască un gard perfect cu ajutorul lui Dorel – un constructor renumit.
Un gard perfect trebuie să respecte următoarele cerințe:
1. Gardul să fie format din N
scânduri de înălțimi nu neapărat egale;
2. Scândurile pot fi așezate în orice ordine;
3. Există un număr egal de scânduri pentru fiecare înălțime;
Mihăiță acceptă un gard ca fiind perfect dacă respectă condițiile de mai sus înainte sau după eliminarea unei singure scânduri. Ajutați-l pe Mihăiță să verifice perfecțiunea celor T
garduri propuse de Dorel.
Info-Oltenia 2020, Clasele VII-VIII
Problema | gard2 | Operații I/O |
gard.in /gard.out
|
---|---|---|---|
Limita timp | 3 secunde | Limita memorie |
Total: 6 MB
/
Stivă 2 MB
|
Id soluție | #49664335 | Utilizator | |
Fișier | gard2.cpp | Dimensiune | 1.17 KB |
Data încărcării | 11 Martie 2024, 16:34 | Scor / rezultat | Eroare de compilare |
gard2.cpp: In function 'int main()': gard2.cpp:25:18: error: expected unqualified-id before '[' token for(auto [x, cnt]: vf){ ^ gard2.cpp:25:18: error: expected ';' before '[' token gard2.cpp:25:22: error: 'cnt' was not declared in this scope for(auto [x, cnt]: vf){ ^ gard2.cpp: In lambda function: gard2.cpp:25:26: error: expected '{' before ':' token for(auto [x, cnt]: vf){ ^ gard2.cpp: In function 'int main()': gard2.cpp:25:26: error: could not convert '<lambda closure object>main()::__lambda4{x}' from 'main()::__lambda4' to 'bool' gard2.cpp:25:26: error: expected ';' before ':' token gard2.cpp:25:26: error: expected primary-expression before ':' token gard2.cpp:25:26: error: expected ')' before ':' token gard2.cpp:25:26: error: expected primary-expression before ':' token gard2.cpp:25:26: error: expected ';' before ':' token gard2.cpp:32:22: error: expected unqualified-id before '[' token for(auto [x, cnt]: vf){ ^ gard2.cpp:32:22: error: expected ';' before '[' token gard2.cpp:32:26: error: 'cnt' was not declared in this scope for(auto [x, cnt]: vf){ ^ gard2.cpp: In lambda function: gard2.cpp:32:30: error: expected '{' before ':' token for(auto [x, cnt]: vf){ ^ gard2.cpp: In function 'int main()': gard2.cpp:32:30: error: could not convert '<lambda closure object>main()::__lambda5{x}' from 'main()::__lambda5' to 'bool' gard2.cpp:32:30: error: expected ';' before ':' token gard2.cpp:32:30: error: expected primary-expression before ':' token gard2.cpp:32:30: error: expected ')' before ':' token gard2.cpp:32:30: error: expected primary-expression before ':' token gard2.cpp:32:30: error: expected ';' before ':' token gard2.cpp:51:1: error: expected '}' at end of input } ^ gard2.cpp:30:18: warning: unused variable 'ok' [-Wunused-variable] bool ok = true; ^ gard2.cpp:31:17: warning: unused variable 'cnte' [-Wunused-variable] int cnte = 0, cnt1 = 0, cntd = 0; ^ gard2.cpp:31:27: warning: unused variable 'cnt1' [-Wunused-variable] int cnte = 0, cnt1 = 0, cntd = 0; ^ gard2.cpp:31:37: warning: unused variable 'cntd' [-Wunused-variable] int cnte = 0, cnt1 = 0, cntd = 0; ^ gard2.cpp:51:1: error: expected '}' at end of input } ^ gard2.cpp:28:14: warning: unused variable 'ans' [-Wunused-variable] bool ans = false; ^ gard2.cpp:51:1: error: expected '}' at end of input } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema gard2 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ă.