#1221
O tablă de șah cu n*n
căsuțe conține niște piese de șah . Să se stabilească dacă anumite căsuțe sunt atacate, neatacate sau ocupate de cel puțin una din acele piese.
Problema | PieseSah | Operații I/O |
![]() piesesah.in /piesesah.out
|
---|---|---|---|
Limita timp | 0.5 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #56747602 | Utilizator | |
Fișier | piesesah.cpp | Dimensiune | 4.15 KB |
Data încărcării | 04 Martie 2025, 16:15 | Scor / rezultat | Eroare de compilare |
piesesah.cpp:1:10: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix] #include <fstream>using namespace std; ^ piesesah.cpp:1:19: warning: extra tokens at end of #include directive [enabled by default] #include <fstream>using namespace std; ^ piesesah.cpp:2:1: error: 'ifstream' does not name a type ifstream fin("piesesah.in"); ^ piesesah.cpp:3:1: error: 'ofstream' does not name a type ofstream fout("piesesah.out"); ^ piesesah.cpp: In function 'int main()': piesesah.cpp:15:5: error: 'fin' was not declared in this scope fin>>n>>m>>t; ^ piesesah.cpp:100:27: error: 'dy' was not declared in this scope col=k+dy[j]; ^ piesesah.cpp:119:23: error: 'dy' was not declared in this scope col=k+dy[j]; ^ piesesah.cpp:138:23: error: 'dy' was not declared in this scope col=k+dy[j]; ^ piesesah.cpp:176:24: error: 'fout' was not declared in this scope if(a[x][y]==0) fout<<0<<endl; ^ piesesah.cpp:176:33: error: 'endl' was not declared in this scope if(a[x][y]==0) fout<<0<<endl; ^ piesesah.cpp:176:33: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from piesesah.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ piesesah.cpp:178:25: error: 'fout' was not declared in this scope if(a[x][y]==-1) fout<<1<<endl; ^ piesesah.cpp:178:34: error: 'endl' was not declared in this scope if(a[x][y]==-1) fout<<1<<endl; ^ piesesah.cpp:178:34: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from piesesah.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ piesesah.cpp:180:94: error: 'fout' was not declared in this scope if(a[x][y]==1 or a[x][y]==2 or a[x][y]==3 or a[x][y]==4 or a[x][y]==5 or a[x][y]==6) fout<<2<<endl; ^ piesesah.cpp:180:103: error: 'endl' was not declared in this scope if(a[x][y]==1 or a[x][y]==2 or a[x][y]==3 or a[x][y]==4 or a[x][y]==5 or a[x][y]==6) fout<<2<<endl; ^ piesesah.cpp:180:103: note: suggested alternative: In file included from /usr/include/c++/4.8/istream:39:0, from /usr/include/c++/4.8/fstream:38, from piesesah.cpp:1: /usr/include/c++/4.8/ostream:564:5: note: 'std::endl' endl(basic_ostream<_CharT, _Traits>& __os) ^ piesesah.cpp:13:19: warning: unused variable 'n1' [-Wunused-variable] int m,n,i,j,k,n1,t,m1,ok,cnt=0,x,y,l,col; ^ piesesah.cpp:13:24: warning: unused variable 'm1' [-Wunused-variable] int m,n,i,j,k,n1,t,m1,ok,cnt=0,x,y,l,col; ^ piesesah.cpp:13:27: warning: unused variable 'ok' [-Wunused-variable] int m,n,i,j,k,n1,t,m1,ok,cnt=0,x,y,l,col; ^ piesesah.cpp:13:30: warning: unused variable 'cnt' [-Wunused-variable] int m,n,i,j,k,n1,t,m1,ok,cnt=0,x,y,l,col; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema PieseSah 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ă.