#418
Subgraf
Se dă lista muchiilor unui graf neorientat cu n
vârfuri, etichetate de la 1
la n
. Din acest graf se elimină toate vârfurile etichetate cu valori prime. Să se determine câte muchii va avea subgraful obținut.
Problema | Subgraf | Operații I/O |
subgraf.in /subgraf.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53856632 | Utilizator | |
Fișier | subgraf.cpp | Dimensiune | 821 B |
Data încărcării | 13 Noiembrie 2024, 11:50 | Scor / rezultat | Eroare de compilare |
subgraf.cpp:7:1: error: stray '\302' in program if(n<2) ^ subgraf.cpp:7:1: error: stray '\240' in program subgraf.cpp:7:1: error: stray '\302' in program subgraf.cpp:7:1: error: stray '\240' in program subgraf.cpp:8:1: error: stray '\302' in program return 0; ^ subgraf.cpp:8:1: error: stray '\240' in program subgraf.cpp:8:1: error: stray '\302' in program subgraf.cpp:8:1: error: stray '\240' in program subgraf.cpp:8:1: error: stray '\302' in program subgraf.cpp:8:1: error: stray '\240' in program subgraf.cpp:8:1: error: stray '\302' in program subgraf.cpp:8:1: error: stray '\240' in program subgraf.cpp:9:1: error: stray '\302' in program if(n==2) ^ subgraf.cpp:9:1: error: stray '\240' in program subgraf.cpp:9:1: error: stray '\302' in program subgraf.cpp:9:1: error: stray '\240' in program subgraf.cpp:10:1: error: stray '\302' in program return 1; ^ subgraf.cpp:10:1: error: stray '\240' in program subgraf.cpp:10:1: error: stray '\302' in program subgraf.cpp:10:1: error: stray '\240' in program subgraf.cpp:10:1: error: stray '\302' in program subgraf.cpp:10:1: error: stray '\240' in program subgraf.cpp:10:1: error: stray '\302' in program subgraf.cpp:10:1: error: stray '\240' in program subgraf.cpp:11:1: error: stray '\302' in program if(n%2==0) ^ subgraf.cpp:11:1: error: stray '\240' in program subgraf.cpp:11:1: error: stray '\302' in program subgraf.cpp:11:1: error: stray '\240' in program subgraf.cpp:12:1: error: stray '\302' in program return 0; ^ subgraf.cpp:12:1: error: stray '\240' in program subgraf.cpp:12:1: error: stray '\302' in program subgraf.cpp:12:1: error: stray '\240' in program subgraf.cpp:12:1: error: stray '\302' in program subgraf.cpp:12:1: error: stray '\240' in program subgraf.cpp:12:1: error: stray '\302' in program subgraf.cpp:12:1: error: stray '\240' in program subgraf.cpp:13:1: error: stray '\302' in program for(int i=3;i*i<=n;i+=2) ^ subgraf.cpp:13:1: error: stray '\240' in program subgraf.cpp:13:1: error: stray '\302' in program subgraf.cpp:13:1: error: stray '\240' in program subgraf.cpp:14:1: error: stray '\302' in program if(n%i==0) ^ subgraf.cpp:14:1: error: stray '\240' in program subgraf.cpp:14:1: error: stray '\302' in program subgraf.cpp:14:1: error: stray '\240' in program subgraf.cpp:14:1: error: stray '\302' in program subgraf.cpp:14:1: error: stray '\240' in program subgraf.cpp:14:1: error: stray '\302' in program subgraf.cpp:14:1: error: stray '\240' in program subgraf.cpp:15:1: error: stray '\302' in program return 0; ^ subgraf.cpp:15:1: error: stray '\240' in program subgraf.cpp:15:1: error: stray '\302' in program subgraf.cpp:15:1: error: stray '\240' in program subgraf.cpp:15:1: error: stray '\302' in program subgraf.cpp:15:1: error: stray '\240' in program subgraf.cpp:15:1: error: stray '\302' in program subgraf.cpp:15:1: error: stray '\240' in program subgraf.cpp:16:1: error: stray '\302' in program return 1; ^ subgraf.cpp:16:1: error: stray '\240' in program subgraf.cpp:16:1: error: stray '\302' in program subgraf.cpp:16:1: error: stray '\240' in program subgraf.cpp:20:1: error: stray '\302' in program int n,m,k,a[101][101],x,y,s=0; ^ subgraf.cpp:20:1: error: stray '\240' in program subgraf.cpp:20:1: error: stray '\302' in program subgraf.cpp:20:1: error: stray '\240' in program subgraf.cpp:21:1: error: stray '\302' in program fin>>n; ^ subgraf.cpp:21:1: error: stray '\240' in program subgraf.cpp:21:1: error: stray '\302' in program subgraf.cpp:21:1: error: stray '\240' in program subgraf.cpp:22:1: error: stray '\302' in program while(fin>>x>>y) ^ subgraf.cpp:22:1: error: stray '\240' in program subgraf.cpp:22:1: error: stray '\302' in program subgraf.cpp:22:1: error: stray '\240' in program subgraf.cpp:22:1: error: stray '\302' in program subgraf.cpp:22:1: error: stray '\240' in program subgraf.cpp:22:1: error: stray '\302' in program subgraf.cpp:22:1: error: stray '\240' in program subgraf.cpp:23:1: error: stray '\302' in program a[x][y]=a[y][x]=1; ^ subgraf.cpp:23:1: error: stray '\240' in program subgraf.cpp:23:1: error: stray '\302' in program subgraf.cpp:23:1: error: stray '\240' in program subgraf.cpp:23:1: error: stray '\302' in program subgraf.cpp:23:1: error: stray '\240' in program subgraf.cpp:23:1: error: stray '\302' in program subgraf.cpp:23:1: error: stray '\240' in program subgraf.cpp:26:1: error: stray '\302' in program for(int i=1;i<=n;i++) ^ subgraf.cpp:26:1: error: stray '\240' in program subgraf.cpp:26:1: error: stray '\302' in program subgraf.cpp:26:1: error: stray '\240' in program subgraf.cpp:27:1: error: stray '\302' in program for(int j=1;j<=n;j++) ^ subgraf.cpp:27:1: error: stray '\240' in program subgraf.cpp:27:1: error: stray '\302' in program subgraf.cpp:27:1: error: stray '\240' in program subgraf.cpp:27:1: error: stray '\302' in program subgraf.cpp:27:1: error: stray '\240' in program subgraf.cpp:27:1: error: stray '\302' in program subgraf.cpp:27:1: error: stray '\240' in program subgraf.cpp:28:1: error: stray '\302' in program { ^ subgraf.cpp:28:1: error: stray '\240' in program subgraf.cpp:28:1: error: stray '\302' in program subgraf.cpp:28:1: error: stray '\240' in program subgraf.cpp:28:1: error: stray '\302' in program subgraf.cpp:28:1: error: stray '\240' in program subgraf.cpp:28:1: error: stray '\302' in program subgraf.cpp:28:1: error: stray '\240' in program subgraf.cpp:29:1: error: stray '\302' in program if(prim(i)==1 or prim(j)==1) ^ subgraf.cpp:29:1: error: stray '\240' in program subgraf.cpp:29:1: error: stray '\302' in program subgraf.cpp:29:1: error: stray '\240' in program subgraf.cpp:29:1: error: stray '\302' in program subgraf.cpp:29:1: error: stray '\240' in program subgraf.cpp:29:1: error: stray '\302' in program subgraf.cpp:29:1: error: stray '\240' in program subgraf.cpp:29:1: error: stray '\302' in program subgraf.cpp:29:1: error: stray '\240' in program subgraf.cpp:29:1: error: stray '\302' in program subgraf.cpp:29:1: error: stray '\240' in program subgraf.cpp:30:1: error: stray '\302' in program a[i][j]=a[j][i]=0; ^ subgraf.cpp:30:1: error: stray '\240' in program subgraf.cpp:30:1: error: stray '\302' in program subgraf.cpp:30:1: error: stray '\240' in program subgraf.cpp:30:1: error: stray '\302' in program subgraf.cpp:30:1: error: stray '\240' in program subgraf.cpp:30:1: error: stray '\302' in program subgraf.cpp:30:1: error: stray '\240' in program subgraf.cpp:31:1: error: stray '\302' in program } ^ subgraf.cpp:31:1: error: stray '\240' in program subgraf.cpp:31:1: error: stray '\302' in program subgraf.cpp:31:1: error: stray '\240' in program subgraf.cpp:31:1: error: stray '\302' in program subgraf.cpp:31:1: error: stray '\240' in program subgraf.cpp:31:1: error: stray '\302' in program subgraf.cpp:31:1: error: stray '\240' in program subgraf.cpp:34:1: error: stray '\302' in program for(int i=1;i<=n;i++) ^ subgraf.cpp:34:1: error: stray '\240' in program subgraf.cpp:34:1: error: stray '\302' in program subgraf.cpp:34:1: error: stray '\240' in program subgraf.cpp:35:1: error: stray '\302' in program { ^ subgraf.cpp:35:1: error: stray '\240' in program subgraf.cpp:35:1: error: stray '\302' in program subgraf.cpp:35:1: error: stray '\240' in program subgraf.cpp:36:1: error: stray '\302' in program for(int j=i+1;j<=n;j++) ^ subgraf.cpp:36:1: error: stray '\240' in program subgraf.cpp:36:1: error: stray '\302' in program subgraf.cpp:36:1: error: stray '\240' in program subgraf.cpp:36:1: error: stray '\302' in program subgraf.cpp:36:1: error: stray '\240' in program subgraf.cpp:36:1: error: stray '\302' in program subgraf.cpp:36:1: error: stray '\240' in program subgraf.cpp:37:1: error: stray '\302' in program if(a[i][j]==1) ^ subgraf.cpp:37:1: error: stray '\240' in program subgraf.cpp:37:1: error: stray '\302' in program subgraf.cpp:37:1: error: stray '\240' in program subgraf.cpp:37:1: error: stray '\302' in program subgraf.cpp:37:1: error: stray '\240' in program subgraf.cpp:37:1: error: stray '\302' in program subgraf.cpp:37:1: error: stray '\240' in program subgraf.cpp:38:1: error: stray '\302' in program s++; ^ subgraf.cpp:38:1: error: stray '\240' in program subgraf.cpp:38:1: error: stray '\302' in program subgraf.cpp:38:1: error: stray '\240' in program subgraf.cpp:38:1: error: stray '\302' in program subgraf.cpp:38:1: error: stray '\240' in program subgraf.cpp:38:1: error: stray '\302' in program subgraf.cpp:38:1: error: stray '\240' in program subgraf.cpp:38:1: error: stray '\302' in program subgraf.cpp:38:1: error: stray '\240' in program subgraf.cpp:38:1: error: stray '\302' in program subgraf.cpp:38:1: error: stray '\240' in program subgraf.cpp:39:1: error: stray '\302' in program } ^ subgraf.cpp:39:1: error: stray '\240' in program subgraf.cpp:39:1: error: stray '\302' in program subgraf.cpp:39:1: error: stray '\240' in program subgraf.cpp:40:1: error: stray '\302' in program fout<<s; ^ subgraf.cpp:40:1: error: stray '\240' in program subgraf.cpp:40:1: error: stray '\302' in program subgraf.cpp:40:1: error: stray '\240' in program subgraf.cpp:41:1: error: stray '\302' in program return 0; ^ subgraf.cpp:41:1: error: stray '\240' in program subgraf.cpp:41:1: error: stray '\302' in program subgraf.cpp:41:1: error: stray '\240' in program subgraf.cpp: In function 'int main()': subgraf.cpp:20:12: warning: unused variable 'm' [-Wunused-variable] int n,m,k,a[101][101],x,y,s=0; ^ subgraf.cpp:20:14: warning: unused variable 'k' [-Wunused-variable] int n,m,k,a[101][101],x,y,s=0; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Subgraf 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ă.