#837
Fill
Se dă o matrice cu n
linii și m
coloane și elemente 0
sau 1
, care reprezintă harta unei planete, în care 1
înseamnă uscat, iar 0
înseamnă apă. Două elemente 1
care se învecinează pe linie sau pe coloană (nu și pe diagonală) fac parte din același continent.
Să se determine câte continente sunt pe hartă.
Problema | Fill | Operații I/O |
fill.in /fill.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #53347546 | Utilizator | |
Fișier | fill.cpp | Dimensiune | 618 B |
Data încărcării | 25 Octombrie 2024, 12:04 | Scor / rezultat | Eroare de compilare |
fill.cpp:3:16: error: expected ',' or '...' before numeric constant void FILL (int 1, int c, int v) ^ fill.cpp: In function 'void FILL(int)': fill.cpp:5:5: error: 'A' was not declared in this scope A[l][c]=v; ^ fill.cpp:5:7: error: 'l' was not declared in this scope A[l][c]=v; ^ fill.cpp:5:10: error: 'c' was not declared in this scope A[l][c]=v; ^ fill.cpp:5:13: error: 'v' was not declared in this scope A[l][c]=v; ^ fill.cpp:7:18: error: 'dx' was not declared in this scope int lv=l+dx[k]; ^ fill.cpp:7:13: warning: unused variable 'lv' [-Wunused-variable] int lv=l+dx[k]; ^ fill.cpp:8:18: error: 'dy' was not declared in this scope int cv=c+dy[k]; ^ fill.cpp:8:21: error: 'k' was not declared in this scope int cv=c+dy[k]; ^ fill.cpp:9:12: error: 'lv' was not declared in this scope if(lv >0 && lv<=n && cv<0 && cv<=m) ^ fill.cpp:9:25: error: 'n' was not declared in this scope if(lv >0 && lv<=n && cv<0 && cv<=m) ^ fill.cpp:9:42: error: 'm' was not declared in this scope if(lv >0 && lv<=n && cv<0 && cv<=m) ^ fill.cpp: In function 'int main()': fill.cpp:15:10: error: 'n' was not declared in this scope cin>>n>>m; ^ fill.cpp:15:13: error: 'm' was not declared in this scope cin>>n>>m; ^ fill.cpp:16:10: error: 'i' was not declared in this scope for (i=1; i<=n; i++) ^ fill.cpp:17:14: error: 'j' was not declared in this scope for (j=1; j<=m; j++) ^ fill.cpp:18:18: error: 'A' was not declared in this scope cin>>A[i][j]; ^ fill.cpp:19:5: error: 'nr' was not declared in this scope nr=1; ^ fill.cpp:20:10: error: 'i' was not declared in this scope for (i=1; i<=n; i++) ^ fill.cpp:21:14: error: 'j' was not declared in this scope for (j=1; j<=m; j++) ^ fill.cpp:22:17: error: 'A' was not declared in this scope if (A[i][j]==1) ^ fill.cpp:27:5: error: 'g' was not declared in this scope g<<nr-1; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Fill 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ă.