#3045
Se consideră 3 progresii aritmetice de numere naturale nenule. Notăm cu P
i
, 1 ≤ i ≤ 3
, mulțimile formate cu elementele progresiei i
. Fie P = P
1
\( \bigcup \) P
2
\( \bigcup \) P
3
reuniunea mulțimilor P
1
, P
2
, P
3
. Să se determine cardinalul mulțimii P
.
Problema | pro3 | Operații I/O |
![]() pro3.in /pro3.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56799597 | Utilizator | |
Fișier | pro3.cpp | Dimensiune | 735 B |
Data încărcării | 06 Martie 2025, 09:59 | Scor / rezultat | Eroare de compilare |
pro3.cpp: In member function 'progresie_t progresie_t::merge(const progresie_t&)': pro3.cpp:9:15: error: 'P_NULL' was not declared in this scope if(*this == P_NULL) { ^ pro3.cpp:13:10: error: 'P_NULL' was not declared in this scope return P_NULL; ^ pro3.cpp: In function 'void read_progresie(progresie_t*)': pro3.cpp:26:34: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'int' [-Wformat=] scanf("%d%d%d", p->a, p->r, p->n); ^ pro3.cpp:26:34: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'int' [-Wformat=] pro3.cpp:26:34: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'int' [-Wformat=] pro3.cpp:26:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d", p->a, p->r, p->n); ^ pro3.cpp: In member function 'progresie_t progresie_t::merge(const progresie_t&)': pro3.cpp:14:2: warning: control reaches end of non-void function [-Wreturn-type] } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema pro3 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ă.