#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 | #54131163 | Utilizator | |
Fișier | fill.cpp | Dimensiune | 728 B |
Data încărcării | 20 Noiembrie 2024, 13:39 | Scor / rezultat | Eroare de compilare |
fill.cpp: In function 'void fill(int, int, int)': fill.cpp:3:5: error: 'a' was not declared in this scope a[i][j] = nr; ^ fill.cpp:5:15: error: 'dx' was not declared in this scope if(a[i+dx[k]][j+dy[k]] == -1) ^ fill.cpp:5:24: error: 'dy' was not declared in this scope if(a[i+dx[k]][j+dy[k]] == -1) ^ fill.cpp: In function 'int main()': fill.cpp:10:5: error: 'f' was not declared in this scope f >> n >> m; ^ fill.cpp:10:10: error: 'n' was not declared in this scope f >> n >> m; ^ fill.cpp:10:15: error: 'm' was not declared in this scope f >> n >> m; ^ fill.cpp:11:9: error: 'i' was not declared in this scope for(i = 1; i <= n; i ++) ^ fill.cpp:12:13: error: 'j' was not declared in this scope for(j = 1; j <= m; j ++) ^ fill.cpp:14:22: error: 'a' was not declared in this scope f >> a[i][j]; ^ fill.cpp:19:9: error: 'i' was not declared in this scope for(i = 0 ; i <= n + 1 ; i ++) ^ fill.cpp:20:9: error: 'a' was not declared in this scope a[i][0] = a[i][m+1] = 0; ^ fill.cpp:22:9: error: 'j' was not declared in this scope for(j = 0 ; j <= m + 1; j ++) ^ fill.cpp:23:9: error: 'a' was not declared in this scope a[0][j] = a[n+1][j] = 0; ^ fill.cpp:25:9: error: 'i' was not declared in this scope for(i = 1; i <= n; i ++) ^ fill.cpp:26:13: error: 'j' was not declared in this scope for(j = 1; j <= m; j ++) ^ fill.cpp:27:16: error: 'a' was not declared in this scope if(a[i][j] == -1) ^ fill.cpp:29:17: error: 'nr' was not declared in this scope nr ++; ^ fill.cpp:33:5: error: 'g' was not declared in this scope g << nr; ^ fill.cpp:33:10: error: 'nr' was not declared in this scope g << nr; ^
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ă.