#1861
TopSort
Se dă un graf orientat aciclic cu N
noduri numerotate de la 1
la N
. Să se realizeze o sortare topologică a nodurilor.
Problema | TopSort | Operații I/O |
topsort.in /topsort.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #22674246 | Utilizator | |
Fișier | topsort.cpp | Dimensiune | 747 B |
Data încărcării | 29 Aprilie 2020, 14:40 | Scor / rezultat | Eroare de compilare |
topsort.cpp:19:1: error: stray '\302' in program f[nod]=1; ^ topsort.cpp:19:1: error: stray '\240' in program topsort.cpp:19:1: error: stray '\302' in program topsort.cpp:19:1: error: stray '\240' in program topsort.cpp:21:1: error: stray '\302' in program for (int i=0;i<L[nod].size();i++) { ^ topsort.cpp:21:1: error: stray '\240' in program topsort.cpp:21:1: error: stray '\302' in program topsort.cpp:21:1: error: stray '\240' in program topsort.cpp:23:1: error: stray '\302' in program int vecin=L[nod][i]; ^ topsort.cpp:23:1: error: stray '\240' in program topsort.cpp:23:1: error: stray '\302' in program topsort.cpp:23:1: error: stray '\240' in program topsort.cpp:23:1: error: stray '\302' in program topsort.cpp:23:1: error: stray '\240' in program topsort.cpp:23:1: error: stray '\302' in program topsort.cpp:23:1: error: stray '\240' in program topsort.cpp:25:1: error: stray '\302' in program if (f[vecin]==0) ^ topsort.cpp:25:1: error: stray '\240' in program topsort.cpp:25:1: error: stray '\302' in program topsort.cpp:25:1: error: stray '\240' in program topsort.cpp:25:1: error: stray '\302' in program topsort.cpp:25:1: error: stray '\240' in program topsort.cpp:25:1: error: stray '\302' in program topsort.cpp:25:1: error: stray '\240' in program topsort.cpp:27:1: error: stray '\302' in program dfs(vecin); ^ topsort.cpp:27:1: error: stray '\240' in program topsort.cpp:27:1: error: stray '\302' in program topsort.cpp:27:1: error: stray '\240' in program topsort.cpp:27:1: error: stray '\302' in program topsort.cpp:27:1: error: stray '\240' in program topsort.cpp:27:1: error: stray '\302' in program topsort.cpp:27:1: error: stray '\240' in program topsort.cpp:27:1: error: stray '\302' in program topsort.cpp:27:1: error: stray '\240' in program topsort.cpp:27:1: error: stray '\302' in program topsort.cpp:27:1: error: stray '\240' in program topsort.cpp:29:1: error: stray '\302' in program } ^ topsort.cpp:29:1: error: stray '\240' in program topsort.cpp:29:1: error: stray '\302' in program topsort.cpp:29:1: error: stray '\240' in program topsort.cpp:31:1: error: stray '\302' in program sol[k++]=nod; ^ topsort.cpp:31:1: error: stray '\240' in program topsort.cpp:31:1: error: stray '\302' in program topsort.cpp:31:1: error: stray '\240' in program topsort.cpp:37:1: error: stray '\302' in program fin>>n>>m; ^ topsort.cpp:37:1: error: stray '\240' in program topsort.cpp:37:1: error: stray '\302' in program topsort.cpp:37:1: error: stray '\240' in program topsort.cpp:39:1: error: stray '\302' in program for (i=1;i<=m;i++) { ^ topsort.cpp:39:1: error: stray '\240' in program topsort.cpp:39:1: error: stray '\302' in program topsort.cpp:39:1: error: stray '\240' in program topsort.cpp:41:1: error: stray '\302' in program fin>>x>>y; ^ topsort.cpp:41:1: error: stray '\240' in program topsort.cpp:41:1: error: stray '\302' in program topsort.cpp:41:1: error: stray '\240' in program topsort.cpp:41:1: error: stray '\302' in program topsort.cpp:41:1: error: stray '\240' in program topsort.cpp:41:1: error: stray '\302' in program topsort.cpp:41:1: error: stray '\240' in program topsort.cpp:43:1: error: stray '\302' in program L[x].push_back(y); ^ topsort.cpp:43:1: error: stray '\240' in program topsort.cpp:43:1: error: stray '\302' in program topsort.cpp:43:1: error: stray '\240' in program topsort.cpp:43:1: error: stray '\302' in program topsort.cpp:43:1: error: stray '\240' in program topsort.cpp:43:1: error: stray '\302' in program topsort.cpp:43:1: error: stray '\240' in program topsort.cpp:45:1: error: stray '\302' in program t[y]=x; ^ topsort.cpp:45:1: error: stray '\240' in program topsort.cpp:45:1: error: stray '\302' in program topsort.cpp:45:1: error: stray '\240' in program topsort.cpp:45:1: error: stray '\302' in program topsort.cpp:45:1: error: stray '\240' in program topsort.cpp:45:1: error: stray '\302' in program topsort.cpp:45:1: error: stray '\240' in program topsort.cpp:47:1: error: stray '\302' in program } ^ topsort.cpp:47:1: error: stray '\240' in program topsort.cpp:47:1: error: stray '\302' in program topsort.cpp:47:1: error: stray '\240' in program topsort.cpp:49:1: error: stray '\302' in program for (i=1;i<=n;i++) ^ topsort.cpp:49:1: error: stray '\240' in program topsort.cpp:49:1: error: stray '\302' in program topsort.cpp:49:1: error: stray '\240' in program topsort.cpp:51:1: error: stray '\302' in program if (f[i]==0) ^ topsort.cpp:51:1: error: stray '\240' in program topsort.cpp:51:1: error: stray '\302' in program topsort.cpp:51:1: error: stray '\240' in program topsort.cpp:51:1: error: stray '\302' in program topsort.cpp:51:1: error: stray '\240' in program topsort.cpp:51:1: error: stray '\302' in program topsort.cpp:51:1: error: stray '\240' in program topsort.cpp:53:1: error: stray '\302' in program dfs(i); ^ topsort.cpp:53:1: error: stray '\240' in program topsort.cpp:53:1: error: stray '\302' in program topsort.cpp:53:1: error: stray '\240' in program topsort.cpp:53:1: error: stray '\302' in program topsort.cpp:53:1: error: stray '\240' in program topsort.cpp:53:1: error: stray '\302' in program topsort.cpp:53:1: error: stray '\240' in program topsort.cpp:53:1: error: stray '\302' in program topsort.cpp:53:1: error: stray '\240' in program topsort.cpp:53:1: error: stray '\302' in program topsort.cpp:53:1: error: stray '\240' in program topsort.cpp:55:1: error: stray '\302' in program while (k--) ^ topsort.cpp:55:1: error: stray '\240' in program topsort.cpp:55:1: error: stray '\302' in program topsort.cpp:55:1: error: stray '\240' in program topsort.cpp:57:1: error: stray '\302' in program fout<<sol[k]<<" "; ^ topsort.cpp:57:1: error: stray '\240' in program topsort.cpp:57:1: error: stray '\302' in program topsort.cpp:57:1: error: stray '\240' in program topsort.cpp:57:1: error: stray '\302' in program topsort.cpp:57:1: error: stray '\240' in program topsort.cpp:57:1: error: stray '\302' in program topsort.cpp:57:1: error: stray '\240' in program topsort.cpp:59:1: error: stray '\302' in program return 0; ^ topsort.cpp:59:1: error: stray '\240' in program topsort.cpp:59:1: error: stray '\302' in program topsort.cpp:59:1: error: stray '\240' in program topsort.cpp: In function 'void dfs(int)': topsort.cpp:21:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i=0;i<L[nod].size();i++) { ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema TopSort 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ă.