#2812
Progresie3
Se dă un șir de cel mult 10
6
numere naturale din intervalul [0,10
3
]
. Se cere să se verifice dacă există un număr natural r
, astfel încât toate numerele distincte din șir să poată fi rearanjate, pentru a forma o progresie aritmetică de rație r
. Se afișează numărul r
, sau mesajul NU
, dacă nu există un astfel de număr.
Subiect Bacalaureat 2017, sesiune august-septembrie
Problema | Progresie3 | Operații I/O |
progresie3.in /progresie3.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #23287479 | Utilizator | |
Fișier | progresie3.cpp | Dimensiune | 588 B |
Data încărcării | 10 Iunie 2020, 11:54 | Scor / rezultat | Eroare de compilare |
progresie3.cpp:9:1: error: stray '\302' in program frecv[i] = 0; ^ progresie3.cpp:9:1: error: stray '\240' in program progresie3.cpp:11:1: error: stray '\302' in program frecv[a] = 1; ^ progresie3.cpp:11:1: error: stray '\240' in program progresie3.cpp:13:1: error: stray '\302' in program ^ progresie3.cpp:13:1: error: stray '\240' in program progresie3.cpp:14:1: error: stray '\302' in program int r = 0, ultim = -1, ok = 0; ^ progresie3.cpp:14:1: error: stray '\240' in program progresie3.cpp:14:1: error: stray '\302' in program progresie3.cpp:14:1: error: stray '\240' in program progresie3.cpp:15:1: error: stray '\302' in program ^ progresie3.cpp:15:1: error: stray '\240' in program progresie3.cpp:16:1: error: stray '\302' in program for (i = 0; i <= 1000 && ok == 0; i++) { ^ progresie3.cpp:16:1: error: stray '\240' in program progresie3.cpp:16:1: error: stray '\302' in program progresie3.cpp:16:1: error: stray '\240' in program progresie3.cpp:17:1: error: stray '\302' in program if (frecv[i] != 0) { ^ progresie3.cpp:17:1: error: stray '\240' in program progresie3.cpp:18:1: error: stray '\302' in program if (ultim != -1) { ^ progresie3.cpp:18:1: error: stray '\240' in program progresie3.cpp:19:1: error: stray '\302' in program if (r == 0) ^ progresie3.cpp:19:1: error: stray '\240' in program progresie3.cpp:19:1: error: stray '\302' in program progresie3.cpp:19:1: error: stray '\240' in program progresie3.cpp:20:1: error: stray '\302' in program r = i - ultim; ^ progresie3.cpp:20:1: error: stray '\240' in program progresie3.cpp:20:1: error: stray '\302' in program progresie3.cpp:20:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program else if (i - ultim != r) ^ progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:21:1: error: stray '\302' in program progresie3.cpp:21:1: error: stray '\240' in program progresie3.cpp:22:1: error: stray '\302' in program ok = 1; ^ progresie3.cpp:22:1: error: stray '\240' in program progresie3.cpp:22:1: error: stray '\302' in program progresie3.cpp:22:1: error: stray '\240' in program progresie3.cpp:23:1: error: stray '\302' in program } ^ progresie3.cpp:23:1: error: stray '\240' in program progresie3.cpp:24:1: error: stray '\302' in program ultim = i; ^ progresie3.cpp:24:1: error: stray '\240' in program progresie3.cpp:24:1: error: stray '\302' in program progresie3.cpp:24:1: error: stray '\240' in program progresie3.cpp:25:1: error: stray '\302' in program } ^ progresie3.cpp:25:1: error: stray '\240' in program progresie3.cpp:27:1: error: stray '\302' in program if (ok == 0) ^ progresie3.cpp:27:1: error: stray '\240' in program progresie3.cpp:28:1: error: stray '\302' in program g<<r; ^ progresie3.cpp:28:1: error: stray '\240' in program progresie3.cpp:30:1: error: stray '\302' in program g<<"NU"; ^ progresie3.cpp:30:1: error: stray '\240' in program progresie3.cpp:31:1: error: stray '\302' in program ^ progresie3.cpp:31:1: error: stray '\240' in program
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Progresie3 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ă.