#1684
NumerePiramidale
C++
Amicul nostru, Zoli, a învățat la scoală despre pătrate perfecte și numere piramidale. Al n
-lea număr piramidal înseamnă suma primelor n
pătrate perfecte, începând de la 1
. Ajutați-l pe Zoli sa afle primele n
numere piramidale.
Problema | NumerePiramidale | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53480967 | Utilizator | |
Fișier | numerepiramidale.cpp | Dimensiune | 7.98 KB |
Data încărcării | 02 Noiembrie 2024, 09:25 | Scor / rezultat | 0 puncte |
In file included from /usr/include/c++/4.8/cassert:43:0, from numerepiramidale.cpp:4: numerepiramidale.cpp: In function 'int main()': numerepiramidale.cpp:122:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(i < power_base.size()); ^ numerepiramidale.cpp:128:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(i < aib0.size()); ^ numerepiramidale.cpp:136:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(pos < final_line.size()); ^ numerepiramidale.cpp:143:41: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(j < final_line.size()); ^ numerepiramidale.cpp:157:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(i < aib1.size()); ^ numerepiramidale.cpp:174:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(st1 < final_line.size()); ^ numerepiramidale.cpp:175:43: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(st2 < final_line.size()); ^ numerepiramidale.cpp: In function 'void UpdateHashSegmentTree(int, int, int, int)': numerepiramidale.cpp:226:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < node && node < seg_tree.size()); ^ numerepiramidale.cpp:227:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < st && st < final_line.size()); ^ numerepiramidale.cpp:228:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < en && st < en && en < final_line.size()); ^ numerepiramidale.cpp: In function 'void BuildSegmentTree(int, int, int)': numerepiramidale.cpp:249:46: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < node && node < seg_tree.size()); ^ numerepiramidale.cpp:250:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < st && st < final_line.size()); ^ numerepiramidale.cpp:251:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < en && en < final_line.size()); ^ numerepiramidale.cpp:256:44: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < st && st < final_line.size()); ^ numerepiramidale.cpp:257:55: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert(0 < en && st < en && en < final_line.size()); ^ numerepiramidale.cpp: In function 'int main()': numerepiramidale.cpp:83:36: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("diez.in", "r", stdin); ^ numerepiramidale.cpp:84:38: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("diez.out", "w", stdout); ^ numerepiramidale.cpp:89:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d %d\n", &N, &M); ^ numerepiramidale.cpp:92:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%s", (initial_line + 1)); ^ numerepiramidale.cpp:95:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &type); ^ numerepiramidale.cpp:98:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &pos1); ^ numerepiramidale.cpp:104:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &pos1); ^ numerepiramidale.cpp:106:32: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &pos2); ^ numerepiramidale.cpp:108:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &lg); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Caught fatal signal 11 | 20 | 0 | Exemplu | |
2 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
3 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
4 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
5 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema NumerePiramidale 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ă.