#1502
Virgule
Se consideră un şir de cifre zecimale (de la 0
la 9
). În acest şir trebuie să inserăm virgule, separând astfel cifrele în scopul de a forma numere.
Scrieţi un program care să insereze virgule în şirul de cifre astfel încât să se obţină o secvenţă de numere strict crescătoare, iar ultimul număr din secvenţă să fie minim.
Olimpiada Municipala Informatica Iasi 2016
Problema | Virgule | Operații I/O |
virgule.in /virgule.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 8 MB
/
Stivă 8 MB
|
Id soluție | #36548103 | Utilizator | |
Fișier | virgule.cpp | Dimensiune | 1.63 KB |
Data încărcării | 08 Mai 2022, 17:23 | Scor / rezultat | 10 puncte |
virgule.cpp: In function 'void bkt(int)': virgule.cpp:15:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(p==s.size()) ^ virgule.cpp:21:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<pos_vg.size();i++) ^ virgule.cpp:30:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=p;i<s.size();i++) ^ virgule.cpp:43:17: warning: unused variable 'a' [-Wunused-variable] int a=sol[pos]*10+s[i]-'0'; ^ virgule.cpp: In function 'int main()': virgule.cpp:55:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<s.size()-1;i++) ^ virgule.cpp:68:34: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<pos_vf_fn.size();i++) ^ virgule.cpp:74:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(;j<s.size();j++) ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
2 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
3 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
4 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
5 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
6 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
7 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
8 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
9 | 0 secunde | OK. | 5 | 5 | ||
10 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
11 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
12 | 0 secunde | OK. | 5 | 5 | ||
13 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
14 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
15 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
16 | 0 secunde | Raspuns gresit. | 5 | 0 | ||
17 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
18 | 0 secunde | Raspuns gresit. | 10 | 0 | ||
Punctaj total | 10 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Virgule 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ă.