#1871
Într-o zi telefonul lui Max s-a stricat.Văzând o reclamă la noul telefon cu sistemul de operare Ubuntu, s-a gândit să achiziționeze și el unul.
Drumul de la casa lui la magazin poate fi reprezentat ca o matrice cu n
linii și m
coloane. În fiecare element al matricei este o barieră; pentru a trece de bariere trebuie plătită o sumă de bani, care nu este aceeași pentru fiecare barieră și poate fi chiar 0
.
Casa lui se află pe coordonatele (ic,jc)
, iar magazinul la coordonatele (im,jm)
.
Pentru că trebuie să cumpere telefonul, este nevoie ca drumul lui sa fie cât mai puțin costisitor, plătind la bariere o sumă totală minimă.
Problema | UbuPH | Operații I/O |
![]() ubuph.in /ubuph.out
|
---|---|---|---|
Limita timp | 1.3 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #57586571 | Utilizator | |
Fișier | ubuph.cpp | Dimensiune | 1.23 KB |
Data încărcării | 06 Aprilie 2025, 15:35 | Scor / rezultat | Eroare de compilare |
ubuph.cpp:4:1: error: stray '\302' in program ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: stray '\302' in program ubuph.cpp:4:1: error: stray '\240' in program ubuph.cpp:4:1: error: 'ifstream' does not name a type ubuph.cpp:4:27: error: 'ofstream' does not name a type ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp:4:174: error: 'queue' does not name a type ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp: In function 'void citire()': ubuph.cpp:4:230: error: 'cin' was not declared in this scope ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp:3:13: error: unable to find numeric literal operator 'operator"" using' #define Max 1000000000using namespace std; ^ ubuph.cpp:4:389: note: in expansion of macro 'Max' ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp:3:29: error: expected ';' before 'namespace' #define Max 1000000000using namespace std; ^ ubuph.cpp:4:389: note: in expansion of macro 'Max' ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp: In function 'void lee()': ubuph.cpp:4:569: error: 'q' was not declared in this scope ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^ ubuph.cpp: In function 'int main()': ubuph.cpp:4:1145: error: 'cout' was not declared in this scope ifstream cin("ubuph.in"); ofstream cout("ubuph.out"); int a[1005][1005],n,m,b[1005][1005]; int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1}; struct date { int x,y; }C,M; queue<date>q; void citire() { int i,j; cin>>n>>m; for(i=1;i<=n;i++) for(j=1;j<=m;j++) { cin>>a[i][j]; b[i][j]=Max; } cin>>M.x>>M.y>>C.x>>C.y; } bool interior(date s) { return s.x>=1 && s.x<=n && s.y>=1 && s.y<=m; } void lee() { date vi,vf; q.push(C); b[C.x][C.y]=a[C.x][C.y]; while(!q.empty()) { vi=q.front(); q.pop(); for(int i=0;i<4;i++) { vf.x=vi.x+dx[i]; vf.y=vi.y+dy[i]; if(interior(vf)&&b[vf.x][vf.y]>b[vi.x][vi.y]+a[vf.x][vf.y]) { q.push(vf); b[vf.x][vf.y]=b[vi.x][vi.y]+a[vf.x][vf.y]; } } } } int main() { citire(); lee(); cout<<b[M.x][M.y]; return 0; } ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema UbuPH 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ă.