#1356
nsir
Să se determine toate șirurile a
de k
numere naturale nu neapărat distincte: 1 ≤ a
1
, a
2
,...,a
k
≤ n
, astfel încât:
1) 1 = 1/a
1
+ 1/a
2
+...+ 1/a
k
2) n = a
1
+ a
2
+...+ a
k
Problema | nsir | Operații I/O |
![]() nsir.in /nsir.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 2 MB
/
Stivă 2 MB
|
Id soluție | #32612990 | Utilizator | |
Fișier | nsir.cpp | Dimensiune | 784 B |
Data încărcării | 21 Noiembrie 2021, 11:31 | Scor / rezultat | Eroare de compilare |
nsir.cpp: In function 'void afisare(int)': nsir.cpp:9:9: error: reference to 'cout' is ambiguous cout << x[i] << " "; ^ nsir.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("nsir.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from nsir.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ nsir.cpp:10:5: error: reference to 'cout' is ambiguous cout << '\n'; ^ nsir.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("nsir.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from nsir.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ nsir.cpp: In function 'void back(int, int, double)': nsir.cpp:22:15: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(sp <= n && sp1 <= 1.00001) ^ nsir.cpp: In function 'int main()': nsir.cpp:32:5: error: reference to 'cin' is ambiguous cin >> n; ^ nsir.cpp:3:10: note: candidates are: std::ifstream cin ifstream cin("nsir.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from nsir.cpp:1: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ nsir.cpp:34:17: error: reference to 'cout' is ambiguous if(ok == 0) cout << 0; ^ nsir.cpp:4:10: note: candidates are: std::ofstream cout ofstream cout("nsir.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from nsir.cpp:1: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema nsir 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ă.