#479
LantMaxim
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și două vârfuri p q
. Să se determine cel mai lung lanț elementar cu extremitățile p
și q
.
Problema | LantMaxim | Operații I/O |
lantmaxim.in /lantmaxim.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #23002780 | Utilizator | |
Fișier | lantmaxim.cpp | Dimensiune | 1.42 KB |
Data încărcării | 17 Mai 2020, 22:35 | Scor / rezultat | Eroare de compilare |
lantmaxim.cpp:1:9: error: #include expects "FILENAME" or <FILENAME> #include <iostream> ^ lantmaxim.cpp:2:9: error: #include expects "FILENAME" or <FILENAME> #include <fstream> ^ lantmaxim.cpp:3:9: error: #include expects "FILENAME" or <FILENAME> #include <string.h> ^ lantmaxim.cpp:4:9: error: #include expects "FILENAME" or <FILENAME> #include <stdlib.h> ^ lantmaxim.cpp:5:1: error: stray '\302' in program using namespace std; ^ lantmaxim.cpp:5:1: error: stray '\240' in program lantmaxim.cpp:5:1: error: stray '\302' in program lantmaxim.cpp:5:1: error: stray '\240' in program lantmaxim.cpp:7:1: error: stray '\302' in program int p,q,n,nr_muchii,adiacenta[20][20]; ^ lantmaxim.cpp:7:1: error: stray '\240' in program lantmaxim.cpp:8:1: error: stray '\302' in program int max_lant=0,lant_actual; ^ lantmaxim.cpp:8:1: error: stray '\240' in program lantmaxim.cpp:9:1: error: stray '\302' in program string sol,s; ^ lantmaxim.cpp:9:1: error: stray '\240' in program lantmaxim.cpp:10:1: error: stray '\302' in program ofstream fol("lantmaxim.out"); ^ lantmaxim.cpp:10:1: error: stray '\240' in program lantmaxim.cpp:12:1: error: stray '\302' in program void nr_varfuri(){ ^ lantmaxim.cpp:12:1: error: stray '\240' in program lantmaxim.cpp:13:1: error: stray '\302' in program ifstream fil("lantmaxim.in"); ^ lantmaxim.cpp:13:1: error: stray '\240' in program lantmaxim.cpp:14:1: error: stray '\302' in program int nod,max=0,k=0; ^ lantmaxim.cpp:14:1: error: stray '\240' in program lantmaxim.cpp:24:1: error: stray '\302' in program void creare_matrice(){ ^ lantmaxim.cpp:24:1: error: stray '\240' in program lantmaxim.cpp:25:1: error: stray '\302' in program ifstream fil("lantmaxim.in"); ^ lantmaxim.cpp:25:1: error: stray '\240' in program lantmaxim.cpp:26:1: error: stray '\302' in program int i,a,b; ^ lantmaxim.cpp:26:1: error: stray '\240' in program lantmaxim.cpp:34:1: error: stray '\302' in program void afisare_adiacenta(){ ^ lantmaxim.cpp:34:1: error: stray '\240' in program lantmaxim.cpp:35:1: error: stray '\302' in program int i,j; ^ lantmaxim.cpp:35:1: error: stray '\240' in program lantmaxim.cpp:44:1: error: stray '\302' in program void back(int k){ ^ lantmaxim.cpp:44:1: error: stray '\240' in program lantmaxim.cpp:44:1: error: stray '\302' in program lantmaxim.cpp:44:1: error: stray '\240' in program lantmaxim.cpp:45:1: error: stray '\302' in program int i,nr_muchii_ramase; ^ lantmaxim.cpp:45:1: error: stray '\240' in program lantmaxim.cpp:46:1: error: stray '\302' in program char buffer[2]; ^ lantmaxim.cpp:46:1: error: stray '\240' in program lantmaxim.cpp:81:1: error: stray '\302' in program int main(){ ^ lantmaxim.cpp:81:1: error: stray '\240' in program lantmaxim.cpp:82:1: error: stray '\302' in program int i; ^ lantmaxim.cpp:82:1: error: stray '\240' in program lantmaxim.cpp:83:1: error: stray '\302' in program ofstream fol("lantmaxim.out"); ^ lantmaxim.cpp:83:1: error: stray '\240' in program lantmaxim.cpp:94:1: error: stray '\302' in program return 0; ^ lantmaxim.cpp:94:1: error: stray '\240' in program lantmaxim.cpp:9:1: error: 'string' does not name a type string sol,s; ^ lantmaxim.cpp:10:1: error: 'ofstream' does not name a type ofstream fol("lantmaxim.out"); ^ lantmaxim.cpp: In function 'void nr_varfuri()': lantmaxim.cpp:13:1: error: 'ifstream' was not declared in this scope ifstream fil("lantmaxim.in"); ^ lantmaxim.cpp:13:11: error: expected ';' before 'fil' ifstream fil("lantmaxim.in"); ^ lantmaxim.cpp:15:7: error: 'fil' was not declared in this scope while(fil>>nod){ ^ lantmaxim.cpp: In function 'void creare_matrice()': lantmaxim.cpp:25:1: error: 'ifstream' was not declared in this scope ifstream fil("lantmaxim.in"); ^ lantmaxim.cpp:25:11: error: expected ';' before 'fil' ifstream fil("lantmaxim.in"); ^ lantmaxim.cpp:28:1: error: 'fil' was not declared in this scope fil>>a>>b; ^ lantmaxim.cpp:32:1: error: 'fil' was not declared in this scope fil>>p>>q; ^ lantmaxim.cpp: In function 'void afisare_adiacenta()': lantmaxim.cpp:38:1: error: 'cout' was not declared in this scope cout<<adiacenta[i][j]<<" "; ^ lantmaxim.cpp:40:1: error: 'cout' was not declared in this scope cout<<endl; ^ lantmaxim.cpp:40:7: error: 'endl' was not declared in this scope cout<<endl; ^ lantmaxim.cpp: In function 'void back(int)': lantmaxim.cpp:52:1: error: 's' was not declared in this scope s=itoa(p,buffer,10); ^ lantmaxim.cpp:52:19: error: 'itoa' was not declared in this scope s=itoa(p,buffer,10); ^ lantmaxim.cpp:55:24: error: 's' was not declared in this scope if(adiacenta[k][i]==1&&s.find(itoa(i,buffer,10))==s.npos){ ^ lantmaxim.cpp:55:47: error: 'itoa' was not declared in this scope if(adiacenta[k][i]==1&&s.find(itoa(i,buffer,10))==s.npos){ ^ lantmaxim.cpp:61:1: error: 'sol' was not declared in this scope sol=s; ^ lantmaxim.cpp:72:1: error: 's' was not declared in this scope s=s.substr(0,s.length()-1); ^ lantmaxim.cpp: In function 'int main()': lantmaxim.cpp:83:1: error: 'ofstream' was not declared in this scope ofstream fol("lantmaxim.out"); ^ lantmaxim.cpp:83:11: error: expected ';' before 'fol' ofstream fol("lantmaxim.out"); ^ lantmaxim.cpp:85:1: error: 'cout' was not declared in this scope cout<<n<<" "<<nr_muchii<<endl; ^ lantmaxim.cpp:85:27: error: 'endl' was not declared in this scope cout<<n<<" "<<nr_muchii<<endl; ^ lantmaxim.cpp:90:11: error: 'sol' was not declared in this scope for(i=0;i<sol.length();i++){ ^ lantmaxim.cpp:91:1: error: 'fol' was not declared in this scope fol<<sol[i]<<" "; ^ lantmaxim.cpp:93:7: error: 'sol' was not declared in this scope cout<<sol<<" "<<max_lant-1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema LantMaxim 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ă.