#4790
Se dă un număr natural N
și apoi N
numere naturale, toate având același număr de cifre.
1) Determinați câte dintre cele N
numere sunt palindrom.
2) Determinați câte dintre cele N
numere pot deveni palindrom prin inserarea în acestea a câte unei cifre.
3) Determinați câte dintre cele N
numere pot deveni palindrom prin inserarea în acestea a câte două cifre.
OJI 2025, clasa a 5-a
Problema | palindrom1 | Operații I/O |
![]() palindrom.in /palindrom.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58452524 | Utilizator | |
Fișier | palindrom1.cpp | Dimensiune | 9.30 KB |
Data încărcării | 05 Iunie 2025, 23:07 | Scor / rezultat | Eroare de compilare |
palindrom1.cpp: In function 'int main()': palindrom1.cpp:153:50: error: 't' was not declared in this scope if (j_is_k1_slot) { t ^ palindrom1.cpp:154:33: error: expected ';' before 'if' if (det_d1 == 0) det_d1 = s_char_val; ^ palindrom1.cpp:155:33: error: expected '}' before 'else' else if (det_d1 != s_char_val) { possible_this_config = false; break; } ^ palindrom1.cpp:157:59: error: 's_char_val' was not declared in this scope if (det_d2 == 0) det_d2 = s_char_val; ^ palindrom1.cpp:158:52: error: 's_char_val' was not declared in this scope else if (det_d2 != s_char_val) { possible_this_config = false; break; } ^ palindrom1.cpp:162:25: error: 'else' without a previous 'if' else { ^ palindrom1.cpp:163:33: error: 'i' was not declared in this scope if (i == j) { ^ palindrom1.cpp:163:38: error: 'j' was not declared in this scope if (i == j) { ^ palindrom1.cpp:171:26: error: 'possible_this_config' was not declared in this scope if (!possible_this_config) continue; ^ palindrom1.cpp:174:25: error: 'd1_must_equal_d2' was not declared in this scope if (d1_must_equal_d2) { ^ palindrom1.cpp:175:29: error: 'det_d1' was not declared in this scope if (det_d1 != 0 && det_d2 != 0 && det_d1 != det_d2) { // Both determined, but to different values ^ palindrom1.cpp:175:44: error: 'det_d2' was not declared in this scope if (det_d1 != 0 && det_d2 != 0 && det_d1 != det_d2) { // Both determined, but to different values ^ palindrom1.cpp:176:29: error: 'possible_this_config' was not declared in this scope possible_this_config = false; ^ palindrom1.cpp:185:26: error: 'possible_this_config' was not declared in this scope if (!possible_this_config) continue; ^ palindrom1.cpp:189:29: error: 'det_d1' was not declared in this scope if (det_d1 == '0') { // d1 is determined to be '0' ^ palindrom1.cpp:190:29: error: 'possible_this_config' was not declared in this scope possible_this_config = false; ^ palindrom1.cpp:193:33: error: 'd1_must_equal_d2' was not declared in this scope if (d1_must_equal_d2 && det_d2 == '0') { ^ palindrom1.cpp:193:53: error: 'det_d2' was not declared in this scope if (d1_must_equal_d2 && det_d2 == '0') { ^ palindrom1.cpp:194:33: error: 'possible_this_config' was not declared in this scope possible_this_config = false; ^ palindrom1.cpp:201:25: error: 'possible_this_config' was not declared in this scope if (possible_this_config) { ^ palindrom1.cpp:208:17: error: 'found_for_current_s' was not declared in this scope if (found_for_current_s) { ^ palindrom1.cpp: At global scope: palindrom1.cpp:214:5: error: 'fout' does not name a type fout << total_count << std::endl; ^ palindrom1.cpp:216:5: error: 'fin' does not name a type fin.close(); ^ palindrom1.cpp:217:5: error: 'fout' does not name a type fout.close(); ^ palindrom1.cpp:219:5: error: expected unqualified-id before 'return' return 0; ^ palindrom1.cpp:220:1: error: expected declaration before '}' token } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema palindrom1 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ă.