#537
ComponenteConexe2
Se dă lista muchiilor unui graf neorientat. Să se determine numărul de muchii care pot fi eliminate din graf astfel încât numărul de componente conexe ale grafului să nu se modifice.
Problema | ComponenteConexe2 | Operații I/O |
componenteconexe2.in /componenteconexe2.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #54888015 | Utilizator | |
Fișier | componenteconexe2.cpp | Dimensiune | 1.70 KB |
Data încărcării | 11 Decembrie 2024, 12:26 | Scor / rezultat | Eroare de compilare |
componenteconexe2.cpp:7:1: error: stray '\302' in program v[105]; /// vectorul care precizeaza daca un varf a fost sau nu vizitat ^ componenteconexe2.cpp:7:1: error: stray '\240' in program componenteconexe2.cpp:7:1: error: stray '\302' in program componenteconexe2.cpp:7:1: error: stray '\240' in program componenteconexe2.cpp:9:1: error: stray '\302' in program nrmu[105]; /// nr muchii din fiecare componenta conexa ^ componenteconexe2.cpp:9:1: error: stray '\240' in program componenteconexe2.cpp:9:1: error: stray '\302' in program componenteconexe2.cpp:9:1: error: stray '\240' in program componenteconexe2.cpp:12:1: error: stray '\302' in program int st=1, dr=1; ^ componenteconexe2.cpp:12:1: error: stray '\240' in program componenteconexe2.cpp:12:1: error: stray '\302' in program componenteconexe2.cpp:12:1: error: stray '\240' in program componenteconexe2.cpp:13:1: error: stray '\302' in program v[varf]=nrc; ^ componenteconexe2.cpp:13:1: error: stray '\240' in program componenteconexe2.cpp:13:1: error: stray '\302' in program componenteconexe2.cpp:13:1: error: stray '\240' in program componenteconexe2.cpp:14:1: error: stray '\302' in program c[1]=varf; ^ componenteconexe2.cpp:14:1: error: stray '\240' in program componenteconexe2.cpp:14:1: error: stray '\302' in program componenteconexe2.cpp:14:1: error: stray '\240' in program componenteconexe2.cpp:15:1: error: stray '\302' in program while(st<=dr) ^ componenteconexe2.cpp:15:1: error: stray '\240' in program componenteconexe2.cpp:15:1: error: stray '\302' in program componenteconexe2.cpp:15:1: error: stray '\240' in program componenteconexe2.cpp:16:1: error: stray '\302' in program { ^ componenteconexe2.cpp:16:1: error: stray '\240' in program componenteconexe2.cpp:16:1: error: stray '\302' in program componenteconexe2.cpp:16:1: error: stray '\240' in program componenteconexe2.cpp:17:1: error: stray '\302' in program int k=c[st]; ^ componenteconexe2.cpp:17:1: error: stray '\240' in program componenteconexe2.cpp:17:1: error: stray '\302' in program componenteconexe2.cpp:17:1: error: stray '\240' in program componenteconexe2.cpp:17:1: error: stray '\302' in program componenteconexe2.cpp:17:1: error: stray '\240' in program componenteconexe2.cpp:17:1: error: stray '\302' in program componenteconexe2.cpp:17:1: error: stray '\240' in program componenteconexe2.cpp:18:1: error: stray '\302' in program for(int i=1; i<=n; ++i) ^ componenteconexe2.cpp:18:1: error: stray '\240' in program componenteconexe2.cpp:18:1: error: stray '\302' in program componenteconexe2.cpp:18:1: error: stray '\240' in program componenteconexe2.cpp:18:1: error: stray '\302' in program componenteconexe2.cpp:18:1: error: stray '\240' in program componenteconexe2.cpp:18:1: error: stray '\302' in program componenteconexe2.cpp:18:1: error: stray '\240' in program componenteconexe2.cpp:19:1: error: stray '\302' in program if(v[i]==0 && a[k][i]==1) ^ componenteconexe2.cpp:19:1: error: stray '\240' in program componenteconexe2.cpp:19:1: error: stray '\302' in program componenteconexe2.cpp:19:1: error: stray '\240' in program componenteconexe2.cpp:19:1: error: stray '\302' in program componenteconexe2.cpp:19:1: error: stray '\240' in program componenteconexe2.cpp:19:1: error: stray '\302' in program componenteconexe2.cpp:19:1: error: stray '\240' in program componenteconexe2.cpp:19:1: error: stray '\302' in program componenteconexe2.cpp:19:1: error: stray '\240' in program componenteconexe2.cpp:19:1: error: stray '\302' in program componenteconexe2.cpp:19:1: error: stray '\240' in program componenteconexe2.cpp:20:1: error: stray '\302' in program { ^ componenteconexe2.cpp:20:1: error: stray '\240' in program componenteconexe2.cpp:20:1: error: stray '\302' in program componenteconexe2.cpp:20:1: error: stray '\240' in program componenteconexe2.cpp:20:1: error: stray '\302' in program componenteconexe2.cpp:20:1: error: stray '\240' in program componenteconexe2.cpp:20:1: error: stray '\302' in program componenteconexe2.cpp:20:1: error: stray '\240' in program componenteconexe2.cpp:20:1: error: stray '\302' in program componenteconexe2.cpp:20:1: error: stray '\240' in program componenteconexe2.cpp:20:1: error: stray '\302' in program componenteconexe2.cpp:20:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program dr++; ^ componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:21:1: error: stray '\302' in program componenteconexe2.cpp:21:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program v[i]=nrc; ^ componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:22:1: error: stray '\302' in program componenteconexe2.cpp:22:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program c[dr]=i; ^ componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:23:1: error: stray '\302' in program componenteconexe2.cpp:23:1: error: stray '\240' in program componenteconexe2.cpp:24:1: error: stray '\302' in program } ^ componenteconexe2.cpp:24:1: error: stray '\240' in program componenteconexe2.cpp:24:1: error: stray '\302' in program componenteconexe2.cpp:24:1: error: stray '\240' in program componenteconexe2.cpp:24:1: error: stray '\302' in program componenteconexe2.cpp:24:1: error: stray '\240' in program componenteconexe2.cpp:24:1: error: stray '\302' in program componenteconexe2.cpp:24:1: error: stray '\240' in program componenteconexe2.cpp:24:1: error: stray '\302' in program componenteconexe2.cpp:24:1: error: stray '\240' in program componenteconexe2.cpp:24:1: error: stray '\302' in program componenteconexe2.cpp:24:1: error: stray '\240' in program componenteconexe2.cpp:25:1: error: stray '\302' in program st ++; ^ componenteconexe2.cpp:25:1: error: stray '\240' in program componenteconexe2.cpp:25:1: error: stray '\302' in program componenteconexe2.cpp:25:1: error: stray '\240' in program componenteconexe2.cpp:25:1: error: stray '\302' in program componenteconexe2.cpp:25:1: error: stray '\240' in program componenteconexe2.cpp:25:1: error: stray '\302' in program componenteconexe2.cpp:25:1: error: stray '\240' in program componenteconexe2.cpp:26:1: error: stray '\302' in program } ^ componenteconexe2.cpp:26:1: error: stray '\240' in program componenteconexe2.cpp:26:1: error: stray '\302' in program componenteconexe2.cpp:26:1: error: stray '\240' in program componenteconexe2.cpp:30:1: error: stray '\302' in program int i,j; ^ componenteconexe2.cpp:30:1: error: stray '\240' in program componenteconexe2.cpp:30:1: error: stray '\302' in program componenteconexe2.cpp:30:1: error: stray '\240' in program componenteconexe2.cpp:31:1: error: stray '\302' in program fin>>n; ^ componenteconexe2.cpp:31:1: error: stray '\240' in program componenteconexe2.cpp:31:1: error: stray '\302' in program componenteconexe2.cpp:31:1: error: stray '\240' in program componenteconexe2.cpp:32:1: error: stray '\302' in program while(fin>>i>>j) ^ componenteconexe2.cpp:32:1: error: stray '\240' in program componenteconexe2.cpp:32:1: error: stray '\302' in program componenteconexe2.cpp:32:1: error: stray '\240' in program componenteconexe2.cpp:33:1: error: stray '\302' in program { ^ componenteconexe2.cpp:33:1: error: stray '\240' in program componenteconexe2.cpp:33:1: error: stray '\302' in program componenteconexe2.cpp:33:1: error: stray '\240' in program componenteconexe2.cpp:34:1: error: stray '\302' in program a[i][j]=a[j][i]=1; ^ componenteconexe2.cpp:34:1: error: stray '\240' in program componenteconexe2.cpp:34:1: error: stray '\302' in program componenteconexe2.cpp:34:1: error: stray '\240' in program componenteconexe2.cpp:34:1: error: stray '\302' in program componenteconexe2.cpp:34:1: error: stray '\240' in program componenteconexe2.cpp:34:1: error: stray '\302' in program componenteconexe2.cpp:34:1: error: stray '\240' in program componenteconexe2.cpp:35:1: error: stray '\302' in program } ^ componenteconexe2.cpp:35:1: error: stray '\240' in program componenteconexe2.cpp:35:1: error: stray '\302' in program componenteconexe2.cpp:35:1: error: stray '\240' in program componenteconexe2.cpp:36:1: error: stray '\302' in program ^ componenteconexe2.cpp:36:1: error: stray '\240' in program componenteconexe2.cpp:36:1: error: stray '\302' in program componenteconexe2.cpp:36:1: error: stray '\240' in program componenteconexe2.cpp:36:1: error: stray '\302' in program componenteconexe2.cpp:36:1: error: stray '\240' in program componenteconexe2.cpp:37:1: error: stray '\302' in program int nrcomp=0;///contor pentru nr de componente conexe ^ componenteconexe2.cpp:37:1: error: stray '\240' in program componenteconexe2.cpp:37:1: error: stray '\302' in program componenteconexe2.cpp:37:1: error: stray '\240' in program componenteconexe2.cpp:38:1: error: stray '\302' in program for(int i=1; i<=n; ++i)///numar componentele conexe ^ componenteconexe2.cpp:38:1: error: stray '\240' in program componenteconexe2.cpp:38:1: error: stray '\302' in program componenteconexe2.cpp:38:1: error: stray '\240' in program componenteconexe2.cpp:39:1: error: stray '\302' in program if(v[i]==0) ^ componenteconexe2.cpp:39:1: error: stray '\240' in program componenteconexe2.cpp:39:1: error: stray '\302' in program componenteconexe2.cpp:39:1: error: stray '\240' in program componenteconexe2.cpp:39:1: error: stray '\302' in program componenteconexe2.cpp:39:1: error: stray '\240' in program componenteconexe2.cpp:39:1: error: stray '\302' in program componenteconexe2.cpp:39:1: error: stray '\240' in program componenteconexe2.cpp:40:1: error: stray '\302' in program { ^ componenteconexe2.cpp:40:1: error: stray '\240' in program componenteconexe2.cpp:40:1: error: stray '\302' in program componenteconexe2.cpp:40:1: error: stray '\240' in program componenteconexe2.cpp:40:1: error: stray '\302' in program componenteconexe2.cpp:40:1: error: stray '\240' in program componenteconexe2.cpp:40:1: error: stray '\302' in program componenteconexe2.cpp:40:1: error: stray '\240' in program componenteconexe2.cpp:41:1: error: stray '\302' in program nrcomp++; ^ componenteconexe2.cpp:41:1: error: stray '\240' in program componenteconexe2.cpp:41:1: error: stray '\302' in program componenteconexe2.cpp:41:1: error: stray '\240' in program componenteconexe2.cpp:41:1: error: stray '\302' in program componenteconexe2.cpp:41:1: error: stray '\240' in program componenteconexe2.cpp:41:1: error: stray '\302' in program componenteconexe2.cpp:41:1: error: stray '\240' in program componenteconexe2.cpp:41:1: error: stray '\302' in program componenteconexe2.cpp:41:1: error: stray '\240' in program componenteconexe2.cpp:41:1: error: stray '\302' in program componenteconexe2.cpp:41:1: error: stray '\240' in program componenteconexe2.cpp:42:1: error: stray '\302' in program bff(i,nrcomp);///apelam bff ^ componenteconexe2.cpp:42:1: error: stray '\240' in program componenteconexe2.cpp:42:1: error: stray '\302' in program componenteconexe2.cpp:42:1: error: stray '\240' in program componenteconexe2.cpp:42:1: error: stray '\302' in program componenteconexe2.cpp:42:1: error: stray '\240' in program componenteconexe2.cpp:42:1: error: stray '\302' in program componenteconexe2.cpp:42:1: error: stray '\240' in program componenteconexe2.cpp:42:1: error: stray '\302' in program componenteconexe2.cpp:42:1: error: stray '\240' in program componenteconexe2.cpp:42:1: error: stray '\302' in program componenteconexe2.cpp:42:1: error: stray '\240' in program componenteconexe2.cpp:43:1: error: stray '\302' in program } ^ componenteconexe2.cpp:43:1: error: stray '\240' in program componenteconexe2.cpp:43:1: error: stray '\302' in program componenteconexe2.cpp:43:1: error: stray '\240' in program componenteconexe2.cpp:43:1: error: stray '\302' in program componenteconexe2.cpp:43:1: error: stray '\240' in program componenteconexe2.cpp:43:1: error: stray '\302' in program componenteconexe2.cpp:43:1: error: stray '\240' in program componenteconexe2.cpp:44:1: error: stray '\302' in program ^ componenteconexe2.cpp:44:1: error: stray '\240' in program componenteconexe2.cpp:44:1: error: stray '\302' in program componenteconexe2.cpp:44:1: error: stray '\240' in program componenteconexe2.cpp:44:1: error: stray '\302' in program componenteconexe2.cpp:44:1: error: stray '\240' in program componenteconexe2.cpp:45:1: error: stray '\302' in program for(int i=1; i<=n; i++)///numar cate varfuri are fiecare componenta conexa ^ componenteconexe2.cpp:45:1: error: stray '\240' in program componenteconexe2.cpp:45:1: error: stray '\302' in program componenteconexe2.cpp:45:1: error: stray '\240' in program componenteconexe2.cpp:46:1: error: stray '\302' in program nrvf[v[i]]++; ^ componenteconexe2.cpp:46:1: error: stray '\240' in program componenteconexe2.cpp:46:1: error: stray '\302' in program componenteconexe2.cpp:46:1: error: stray '\240' in program componenteconexe2.cpp:46:1: error: stray '\302' in program componenteconexe2.cpp:46:1: error: stray '\240' in program componenteconexe2.cpp:46:1: error: stray '\302' in program componenteconexe2.cpp:46:1: error: stray '\240' in program componenteconexe2.cpp:47:1: error: stray '\302' in program ///numar cate muchii are fiecare componenta conexa ^ componenteconexe2.cpp:47:1: error: stray '\240' in program componenteconexe2.cpp:47:1: error: stray '\302' in program componenteconexe2.cpp:47:1: error: stray '\240' in program componenteconexe2.cpp:48:1: error: stray '\302' in program for(int i=1; i<n; i++) ^ componenteconexe2.cpp:48:1: error: stray '\240' in program componenteconexe2.cpp:48:1: error: stray '\302' in program componenteconexe2.cpp:48:1: error: stray '\240' in program componenteconexe2.cpp:49:1: error: stray '\302' in program for(int j=i+1; j<=n; ++j) ^ componenteconexe2.cpp:49:1: error: stray '\240' in program componenteconexe2.cpp:49:1: error: stray '\302' in program componenteconexe2.cpp:49:1: error: stray '\240' in program componenteconexe2.cpp:49:1: error: stray '\302' in program componenteconexe2.cpp:49:1: error: stray '\240' in program componenteconexe2.cpp:49:1: error: stray '\302' in program componenteconexe2.cpp:49:1: error: stray '\240' in program componenteconexe2.cpp:50:1: error: stray '\302' in program if(a[i][j]==1) ^ componenteconexe2.cpp:50:1: error: stray '\240' in program componenteconexe2.cpp:50:1: error: stray '\302' in program componenteconexe2.cpp:50:1: error: stray '\240' in program componenteconexe2.cpp:50:1: error: stray '\302' in program componenteconexe2.cpp:50:1: error: stray '\240' in program componenteconexe2.cpp:50:1: error: stray '\302' in program componenteconexe2.cpp:50:1: error: stray '\240' in program componenteconexe2.cpp:50:1: error: stray '\302' in program componenteconexe2.cpp:50:1: error: stray '\240' in program componenteconexe2.cpp:50:1: error: stray '\302' in program componenteconexe2.cpp:50:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program nrmc[v[i]]++; ^ componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:51:1: error: stray '\302' in program componenteconexe2.cpp:51:1: error: stray '\240' in program componenteconexe2.cpp:52:1: error: stray '\302' in program /// rezultatul este din fiecare componenta putem elimina atatea muchii incat sa ramana arbore ^ componenteconexe2.cpp:52:1: error: stray '\240' in program componenteconexe2.cpp:52:1: error: stray '\302' in program componenteconexe2.cpp:52:1: error: stray '\240' in program componenteconexe2.cpp:53:1: error: stray '\302' in program int C=0; ^ componenteconexe2.cpp:53:1: error: stray '\240' in program componenteconexe2.cpp:53:1: error: stray '\302' in program componenteconexe2.cpp:53:1: error: stray '\240' in program componenteconexe2.cpp:54:1: error: stray '\302' in program for(int i=1; i<=nrcomp; ++i) ^ componenteconexe2.cpp:54:1: error: stray '\240' in program componenteconexe2.cpp:54:1: error: stray '\302' in program componenteconexe2.cpp:54:1: error: stray '\240' in program componenteconexe2.cpp:55:1: error: stray '\302' in program C+=nrmc[i]-nrvf[i]+1; ^ componenteconexe2.cpp:55:1: error: stray '\240' in program componenteconexe2.cpp:55:1: error: stray '\302' in program componenteconexe2.cpp:55:1: error: stray '\240' in program componenteconexe2.cpp:55:1: error: stray '\302' in program componenteconexe2.cpp:55:1: error: stray '\240' in program componenteconexe2.cpp:55:1: error: stray '\302' in program componenteconexe2.cpp:55:1: error: stray '\240' in program componenteconexe2.cpp:56:1: error: stray '\302' in program fout<<C; ^ componenteconexe2.cpp:56:1: error: stray '\240' in program componenteconexe2.cpp:56:1: error: stray '\302' in program componenteconexe2.cpp:56:1: error: stray '\240' in program componenteconexe2.cpp:57:1: error: stray '\302' in program return 0; ^ componenteconexe2.cpp:57:1: error: stray '\240' in program componenteconexe2.cpp:57:1: error: stray '\302' in program componenteconexe2.cpp:57:1: error: stray '\240' in program componenteconexe2.cpp: In function 'int main()': componenteconexe2.cpp:51:25: error: 'nrmc' was not declared in this scope nrmc[v[i]]++; ^ componenteconexe2.cpp:55:16: error: 'nrmc' was not declared in this scope C+=nrmc[i]-nrvf[i]+1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema ComponenteConexe2 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ă.