#2843
Puteri6
Se dă un număr natural n
(1 ≤ n ≤ 10
6
) și un șir cu cel mult 1.000.000
de elemente, numere naturale de forma 10
p
(0 ≤ p ≤ 9
). Se cere să se afișeze numărul care ar apărea pe poziția n
în șirul ordonat crescător. Dacă șirul are mai puțin de n
termeni, se afișează mesajul Nu exista
.
Subiect Bacalaureat 2014, sesiune august-septembrie
Problema | Puteri6 | Operații I/O |
puteri6.in /puteri6.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 2 MB
/
Stivă 2 MB
|
Id soluție | #53425504 | Utilizator | |
Fișier | puteri6.cpp | Dimensiune | 1.62 KB |
Data încărcării | 29 Octombrie 2024, 19:50 | Scor / rezultat | Eroare de compilare |
puteri6.cpp:2:10: error: stray '#' in program Problema #2843 – Puteri6 – Rezolvari PBInfo ^ puteri6.cpp:2:1: error: stray '\342' in program Problema #2843 – Puteri6 – Rezolvari PBInfo ^ puteri6.cpp:2:1: error: stray '\200' in program puteri6.cpp:2:1: error: stray '\223' in program puteri6.cpp:2:1: error: stray '\342' in program puteri6.cpp:2:1: error: stray '\200' in program puteri6.cpp:2:1: error: stray '\223' in program puteri6.cpp:5:1: error: stray '\310' in program Cerința ^ puteri6.cpp:5:1: error: stray '\233' in program puteri6.cpp:6:1: error: stray '\304' in program Se dă un număr natural n (1≤n≤106 ), și un șir cu cel mult 1000000 de elemente, numere naturale de forma 10p (0≤p≤9). Se cere să se afișeze numărul care ar apărea pe poziția n în șirul ordonat crescător. Dacă șirul are mai puțin de n termeni, se afișează mesajul Nu exista. ^ puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\342' in program puteri6.cpp:6:1: error: stray '\211' in program puteri6.cpp:6:1: error: stray '\244' in program puteri6.cpp:6:1: error: stray '\342' in program puteri6.cpp:6:1: error: stray '\211' in program puteri6.cpp:6:1: error: stray '\244' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\231' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\231' in program puteri6.cpp:6:1: error: stray '\342' in program puteri6.cpp:6:1: error: stray '\211' in program puteri6.cpp:6:1: error: stray '\244' in program puteri6.cpp:6:1: error: stray '\342' in program puteri6.cpp:6:1: error: stray '\211' in program puteri6.cpp:6:1: error: stray '\244' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\231' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\233' in program puteri6.cpp:6:1: error: stray '\303' in program puteri6.cpp:6:1: error: stray '\256' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\231' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\231' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\233' in program puteri6.cpp:6:1: error: stray '\310' in program puteri6.cpp:6:1: error: stray '\231' in program puteri6.cpp:6:1: error: stray '\304' in program puteri6.cpp:6:1: error: stray '\203' in program puteri6.cpp:9:1: error: stray '\310' in program Fișierul de intrare puteri6.in conține pe prima linie numărul n, iar pe a doua linie elementele șirului dat, separate prin spații. ^ puteri6.cpp:9:1: error: stray '\231' in program puteri6.cpp:9:1: error: stray '\310' in program puteri6.cpp:9:1: error: stray '\233' in program puteri6.cpp:9:1: error: stray '\304' in program puteri6.cpp:9:1: error: stray '\203' in program puteri6.cpp:9:1: error: stray '\310' in program puteri6.cpp:9:1: error: stray '\231' in program puteri6.cpp:9:1: error: stray '\310' in program puteri6.cpp:9:1: error: stray '\233' in program puteri6.cpp:11:1: error: stray '\310' in program Date de ieșire ^ puteri6.cpp:11:1: error: stray '\231' in program puteri6.cpp:12:1: error: stray '\310' in program Fișierul de ieșire puteri6.out va conține pe prima linie numărul care ar apărea pe poziția n în șirul ordonat crescător sau mesajul Nu exista, dacă șirul are mai puțin de n termeni. ^ puteri6.cpp:12:1: error: stray '\231' in program puteri6.cpp:12:1: error: stray '\310' in program puteri6.cpp:12:1: error: stray '\231' in program puteri6.cpp:12:1: error: stray '\310' in program puteri6.cpp:12:1: error: stray '\233' in program puteri6.cpp:12:1: error: stray '\304' in program puteri6.cpp:12:1: error: stray '\203' in program puteri6.cpp:12:1: error: stray '\304' in program puteri6.cpp:12:1: error: stray '\203' in program puteri6.cpp:12:1: error: stray '\310' in program puteri6.cpp:12:1: error: stray '\233' in program puteri6.cpp:12:1: error: stray '\303' in program puteri6.cpp:12:1: error: stray '\256' in program puteri6.cpp:12:1: error: stray '\310' in program puteri6.cpp:12:1: error: stray '\231' in program puteri6.cpp:12:1: error: stray '\304' in program puteri6.cpp:12:1: error: stray '\203' in program puteri6.cpp:12:1: error: stray '\304' in program puteri6.cpp:12:1: error: stray '\203' in program puteri6.cpp:12:1: error: stray '\310' in program puteri6.cpp:12:1: error: stray '\231' in program puteri6.cpp:12:1: error: stray '\310' in program puteri6.cpp:12:1: error: stray '\233' in program puteri6.cpp:14:1: error: stray '\310' in program Restricții și precizări ^ puteri6.cpp:14:1: error: stray '\233' in program puteri6.cpp:14:1: error: stray '\310' in program puteri6.cpp:14:1: error: stray '\231' in program puteri6.cpp:14:1: error: stray '\304' in program puteri6.cpp:14:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\304' in program Pentru determinarea numărului cerut se utilizează un algoritm eficient din punctul de vedere al timpului de executare. Se recomandă evitarea memorării valorilor elementelor din șir într-un tablou sau în altă structură de date similară. ^ puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\304' in program puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\304' in program puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\304' in program puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\310' in program puteri6.cpp:15:1: error: stray '\231' in program puteri6.cpp:15:1: error: stray '\303' in program puteri6.cpp:15:1: error: stray '\256' in program puteri6.cpp:15:1: error: stray '\303' in program puteri6.cpp:15:1: error: stray '\256' in program puteri6.cpp:15:1: error: stray '\304' in program puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\304' in program puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:15:1: error: stray '\304' in program puteri6.cpp:15:1: error: stray '\203' in program puteri6.cpp:2:1: error: 'Problema' does not name a type Problema #2843 – Puteri6 – Rezolvari PBInfo ^ puteri6.cpp: In function 'int main()': puteri6.cpp:32:5: error: reference to 'cin' is ambiguous cin >> n; ^ puteri6.cpp:26:10: note: candidates are: std::ifstream cin ifstream cin("puteri6.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from puteri6.cpp:24: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ puteri6.cpp:33:11: error: reference to 'cin' is ambiguous while(cin >> x) ^ puteri6.cpp:26:10: note: candidates are: std::ifstream cin ifstream cin("puteri6.in"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from puteri6.cpp:24: /usr/include/c++/4.8/iostream:60:18: note: std::istream std::cin extern istream cin; /// Linked to standard input ^ puteri6.cpp:46:17: error: reference to 'cout' is ambiguous cout << pow(10 , i); ^ puteri6.cpp:27:10: note: candidates are: std::ofstream cout ofstream cout("puteri6.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from puteri6.cpp:24: /usr/include/c++/4.8/iostream:61:18: note: std::ostream std::cout extern ostream cout; /// Linked to standard output ^ puteri6.cpp:50:9: error: reference to 'cout' is ambiguous cout << "Nu exisa"; ^ puteri6.cpp:27:10: note: candidates are: std::ofstream cout ofstream cout("puteri6.out"); ^ In file included from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:74:0, from puteri6.cpp:24: /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 Puteri6 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ă.