#1327
Se citeşte un număr natural nenul n, apoi n numere naturale distincte. Să se afişeze, în ordine lexicografică, șirurile din cele n valori cu proprietatea că oricare două valori învecinate sunt prime între ele.
| Problema | SirPIE | Operații I/O |
sirpie.in/sirpie.out
|
|---|---|---|---|
| Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64168920 | Utilizator | |
| Fișier | sirpie.cpp | Dimensiune | 916 B |
| Data încărcării | 21 Aprilie 2026, 12:42 | Scor/rezultat | Eroare de compilare |
sirpie.cpp: In function ‘int cmmdc(int, int)’: sirpie.cpp:13:2: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation] 13 | {while(a!=b) | ^~~~~ sirpie.cpp:18:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’ 18 | return 0;} | ^~~~~~ sirpie.cpp: In function ‘bool OK(int)’: sirpie.cpp:21:5: warning: this ‘for’ clause does not guard... [-Wmisleading-indentation] 21 | for(int i=1;i<k;++i) | ^~~ sirpie.cpp:24:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’ 24 | if(k>1 | ^~ sirpie.cpp:24:12: warning: init-statement in selection statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 24 | if(k>1 | ^ sirpie.cpp:24:15: error: expected ‘;’ before ‘if’ 24 | if(k>1 | ^ | ; 25 | if(cmmdc(a(x[k]),a(x[k-1]))!=1) | ~~ sirpie.cpp:24:13: warning: statement has no effect [-Wunused-value] 24 | if(k>1 | ~^~ sirpie.cpp:27:1: error: expected primary-expression before ‘}’ token 27 | } | ^ sirpie.cpp:26:14: error: expected ‘)’ before ‘}’ token 26 | return 0; | ^ | ) 27 | } | ~ sirpie.cpp:24:11: note: to match this ‘(’ 24 | if(k>1 | ^ sirpie.cpp:27:1: error: expected primary-expression before ‘}’ token 27 | } | ^ sirpie.cpp: In function ‘void back(int)’: sirpie.cpp:38:11: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else] 38 | if( OK(k) ) | ^ sirpie.cpp: In function ‘bool OK(int)’: sirpie.cpp:27:1: warning: control reaches end of non-void function [-Wreturn-type] 27 | } | ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema SirPIE 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ă.