#2712
Semne
Fie un număr n
natural nenul, determinați un număr k
și o combinație de semne +
sau -
(mai exact o succesiune \( x_1, x_2, …, x_k \) unde \( x_i \in \left\{ -1 , 1 \right\} \), astfel încat să aibă loc relația: \( n = {x}_{1} \cdot {1}^{2}+{x}_{2}\cdot{2}^{2}+…+{x}_{k}\cdot{k}^{2} \). Să se afișeze o succesiune de k
semne +
sau -
care să îndeplinească relația de mai sus.
Problema | Semne | Operații I/O | tastatură/ecran |
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #45740201 | Utilizator | |
Fișier | semne.cpp | Dimensiune | 2.29 KB |
Data încărcării | 20 Octombrie 2023, 10:20 | Scor / rezultat | Eroare de compilare |
semne.cpp:1:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:1:1: error: missing terminating " character """ ^ semne.cpp:13:12: warning: missing terminating " character [enabled by default] print(ok)""" ^ semne.cpp:13:1: error: missing terminating " character print(ok)""" ^ semne.cpp:15:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:15:1: error: missing terminating " character """ ^ semne.cpp:31:2: error: invalid preprocessing directive #input #input = 4.25,4.05,4.25,4.48,4.30,4.40 ^ semne.cpp:32:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:32:1: error: missing terminating " character """ ^ semne.cpp:33:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:33:1: error: missing terminating " character """ ^ semne.cpp:34:3: error: invalid preprocessing directive #o # o problema oarecare (7,8,9) ^ semne.cpp:43:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:43:1: error: missing terminating " character """ ^ semne.cpp:45:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:45:1: error: missing terminating " character """ ^ semne.cpp:49:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:49:1: error: missing terminating " character """ ^ semne.cpp:50:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:50:1: error: missing terminating " character """ ^ semne.cpp:59:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:59:1: error: missing terminating " character """ ^ semne.cpp:60:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:60:1: error: missing terminating " character """ ^ semne.cpp:69:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:69:1: error: missing terminating " character """ ^ semne.cpp:71:3: warning: missing terminating " character [enabled by default] """ scriere a unui nr ca suma de nr din sirul lui fibonacci la distanta de minim 2 intre ele ^ semne.cpp:71:1: error: missing terminating " character """ scriere a unui nr ca suma de nr din sirul lui fibonacci la distanta de minim 2 intre ele ^ semne.cpp:86:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:86:1: error: missing terminating " character """ ^ semne.cpp:87:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:87:1: error: missing terminating " character """ ^ semne.cpp:97:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:97:1: error: missing terminating " character """ ^ semne.cpp:98:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:98:1: error: missing terminating " character """ ^ semne.cpp:108:3: warning: missing terminating " character [enabled by default] """ ^ semne.cpp:108:1: error: missing terminating " character """ ^ semne.cpp:121:34: error: stray '#' in program vout[pozitie] = '-' # 0 = '-' ^ semne.cpp:1:1: error: expected unqualified-id before string constant """ ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Semne 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ă.