#474
VerifLant
Se dă lista muchiilor unui graf neorientat cu n
vârfuri și o succesiune de k
vârfuri. Să se verifice dacă vârfurile din succesiune formează un lanț.
Problema | VerifLant | Operații I/O |
veriflant.in /veriflant.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #48079322 | Utilizator | |
Fișier | veriflant.cpp | Dimensiune | 1008 B |
Data încărcării | 15 Ianuarie 2024, 11:42 | Scor / rezultat | Eroare de compilare |
veriflant.cpp:6:1: error: expected ',' or ';' before 'ofstream' ofstream fout("veriflant.out"); ^ veriflant.cpp: In function 'int distincte(int*, int)': veriflant.cpp:20:10: error: 'i' was not declared in this scope for(i = 1; i < l; i++) ^ veriflant.cpp:21:13: error: 'j' was not declared in this scope for(j = i + 1; j <= l; j++) ^ veriflant.cpp: In function 'int main()': veriflant.cpp:28:12: error: 'k' was not declared in this scope fin >> k; // nr-ul de siruri ^ veriflant.cpp:29:9: error: 'i' was not declared in this scope for(i = 1; i <=k,i++) ^ veriflant.cpp:29:25: error: expected ';' before ')' token for(i = 1; i <=k,i++) ^ veriflant.cpp:31:9: error: 'f' was not declared in this scope f >> l; // lungimea unui sir ^ veriflant.cpp:31:14: error: 'l' was not declared in this scope f >> l; // lungimea unui sir ^ veriflant.cpp:32:9: error: 'j' was not declared in this scope for(j = 1; j <= l; j++) ^ veriflant.cpp:33:16: error: 'v' was not declared in this scope fin >> v[j]; ^ veriflant.cpp:34:13: error: 'v' was not declared in this scope if(lant(v,l)) ^ veriflant.cpp:34:16: error: 'lant' was not declared in this scope if(lant(v,l)) ^ veriflant.cpp:36:5: error: 'fout' was not declared in this scope fout << "ELEMENTAR"; ^ veriflant.cpp:37:14: error: 'fout' was not declared in this scope else fout << "NEELEMENTAR"; } ^ veriflant.cpp:34:7: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if(lant(v,l)) ^ veriflant.cpp:38:9: error: 'else' without a previous 'if' else fout << "NU"; ^ veriflant.cpp:38:14: error: 'fout' was not declared in this scope else fout << "NU"; ^ veriflant.cpp: In function 'int lant(int*, int)': veriflant.cpp:43:8: error: 'i' was not declared in this scope if(i > v[1] || v[1] > n) return 0; ^ veriflant.cpp:44:9: error: 'i' was not declared in this scope for(i = 2; i <= l; i++) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema VerifLant 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ă.