Detalii evaluare #53342717

Rezumat problemă

Se dă o tablă de șah formată din n linii și m coloane, definind n*m zone, unele dintre ele fiind libere, altele conținând obstacole. În zona de coordonate 1 1 se află un cal care se poate deplasa pe tablă în L, ca la șah, fără a părăsi tabla, fără a trece prin zone care conțin obstacole și fără a trece de două ori prin aceeași zonă.

Determinați o modalitate prin care calul poate ajunge în zona de coordonate n m – unde se află o căpiță de fân.

Detalii

Problema TraseuCal Operații I/O traseucal.in/traseucal.out
Limita timp 1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #53342717 Utilizator Andries Ana Maria (Andries_Ana_Maria)
Fișier traseucal.cpp Dimensiune 1.47 KB
Data încărcării 25 Octombrie 2024, 09:34 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

traseucal.cpp:73:16: warning: multi-character character constant [-Wmultichar]
          fout<<'/n';

                ^
traseucal.cpp:5:1: error: expected ',' or ';' before 'ofstream'
 ofstream fout("soarece.out")

 ^
traseucal.cpp:7:14: warning: left operand of comma operator has no effect [-Wunused-value]
 int dx[]=(-1,0,1,-1);

              ^
traseucal.cpp:7:16: warning: right operand of comma operator has no effect [-Wunused-value]
 int dx[]=(-1,0,1,-1);

                ^
traseucal.cpp:7:19: warning: right operand of comma operator has no effect [-Wunused-value]
 int dx[]=(-1,0,1,-1);

                   ^
traseucal.cpp:7:20: error: initializer fails to determine size of 'dx'
 int dx[]=(-1,0,1,-1);

                    ^
traseucal.cpp:7:20: error: array must be initialized with a brace-enclosed initializer
traseucal.cpp:8:14: warning: left operand of comma operator has no effect [-Wunused-value]
 int dy[]=(-1,0,1,-1);

              ^
traseucal.cpp:8:16: warning: right operand of comma operator has no effect [-Wunused-value]
 int dy[]=(-1,0,1,-1);

                ^
traseucal.cpp:8:19: warning: right operand of comma operator has no effect [-Wunused-value]
 int dy[]=(-1,0,1,-1);

                   ^
traseucal.cpp:8:20: error: initializer fails to determine size of 'dy'
 int dy[]=(-1,0,1,-1);

                    ^
traseucal.cpp:8:20: error: array must be initialized with a brace-enclosed initializer
traseucal.cpp: In function 'void citire()':
traseucal.cpp:12:10: error: 'n' was not declared in this scope
     fin>>n>>m;

          ^
traseucal.cpp:12:13: error: 'm' was not declared in this scope
     fin>>n>>m;

             ^
traseucal.cpp:16:20: error: 'a' was not declared in this scope
         if(c=='_') a[i][j]=0;

                    ^
traseucal.cpp:16:22: error: 'i' was not declared in this scope
         if(c=='_') a[i][j]=0;

                      ^
traseucal.cpp:16:25: error: 'j' was not declared in this scope
         if(c=='_') a[i][j]=0;

                         ^
traseucal.cpp:17:20: error: 'a' was not declared in this scope
         if(c=='#') a[i][j]=1;

                    ^
traseucal.cpp:17:22: error: 'i' was not declared in this scope
         if(c=='#') a[i][j]=1;

                      ^
traseucal.cpp:17:25: error: 'j' was not declared in this scope
         if(c=='#') a[i][j]=1;

                         ^
traseucal.cpp:20:17: error: 'a' was not declared in this scope
                 a[i][j]=0;

                 ^
traseucal.cpp:20:19: error: 'i' was not declared in this scope
                 a[i][j]=0;

                   ^
traseucal.cpp:20:22: error: 'j' was not declared in this scope
                 a[i][j]=0;

                      ^
traseucal.cpp:21:17: error: 'is' was not declared in this scope
                 is=i;js=j;

                 ^
traseucal.cpp:21:22: error: 'js' was not declared in this scope
                 is=i;js=j;

                      ^
traseucal.cpp:25:13: error: 'a' was not declared in this scope
             a[i][j]=0;

             ^
traseucal.cpp:25:15: error: 'i' was not declared in this scope
             a[i][j]=0;

               ^
traseucal.cpp:25:18: error: 'j' was not declared in this scope
             a[i][j]=0;

                  ^
traseucal.cpp:26:13: error: 'ib' was not declared in this scope
             ib=i;

             ^
traseucal.cpp:27:13: error: 'jb' was not declared in this scope
             jb=j;

             ^
traseucal.cpp: In function 'void afis()':
traseucal.cpp:32:20: error: 'n' was not declared in this scope
     for(int i=1;i<=n;i++)

                    ^
traseucal.cpp:34:24: error: 'm' was not declared in this scope
         for(int j=1;j<=m;j++)

                        ^
traseucal.cpp:36:13: error: 'fout' was not declared in this scope
             fout<<a[i][j];

             ^
traseucal.cpp:36:19: error: 'a' was not declared in this scope
             fout<<a[i][j];

                   ^
traseucal.cpp: In function 'void bkt(int, int, int)':
traseucal.cpp:42:24: error: 'nr' was not declared in this scope
     for(int i=0;i<8 && nr==0 ;i++)

                        ^
traseucal.cpp:46:29: error: 'n' was not declared in this scope
         if(xnou>=1 && xnou<=n && ynou>=1 && ynou<=m && a[xnou][ynou]==0)

                             ^
traseucal.cpp:46:51: error: 'm' was not declared in this scope
         if(xnou>=1 && xnou<=n && ynou>=1 && ynou<=m && a[xnou][ynou]==0)

                                                   ^
traseucal.cpp:46:56: error: 'a' was not declared in this scope
         if(xnou>=1 && xnou<=n && ynou>=1 && ynou<=m && a[xnou][ynou]==0)

                                                        ^
traseucal.cpp:49:13: error: 'fout' was not declared in this scope
             fout<<xnou<<" "<<ynou<<endl;

             ^
traseucal.cpp:50:22: error: 'ib' was not declared in this scope
             if(xnou==ib && ynou==jb)

                      ^
traseucal.cpp:50:34: error: 'jb' was not declared in this scope
             if(xnou==ib && ynou==jb)

                                  ^
traseucal.cpp:54:13: error: expected ';' before '}' token
             }

             ^
traseucal.cpp: In function 'int main()':
traseucal.cpp:67:5: error: 'a' was not declared in this scope
     a[1][1]=1;

     ^
traseucal.cpp:69:8: error: 'nr' was not declared in this scope
     if(nr==0)

        ^
traseucal.cpp:70:25: error: 'n' was not declared in this scope
          for(int i=1;i<=n;i++)

                         ^
traseucal.cpp:71:25: error: 'm' was not declared in this scope
          for(int j=1;j<=m;j++)

                         ^
traseucal.cpp:72:10: error: 'fout' was not declared in this scope
          fout<<'0'<<" ";

          ^
traseucal.cpp:73:10: error: 'fout' was not declared in this scope
          fout<<'/n';

          ^

Cum funcționează evaluarea?

www.pbinfo.ro permite evaluarea a două tipuri de probleme:

  • probleme la care rezolvarea presupune scrierea unui program complet
  • probleme la care rezolvarea presupune scrierea unei secvențe de program - câteva instrucțiuni, o listă de declarații, una sau mai multe funcții, etc.

Problema TraseuCal face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:

  • Programul sursă este compilat folosind compilatorul corespunzător. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Dacă programul a fost compilat, executabilul obținut va fi rulat, furnizându-i-se unul sau mai multe seturi de date de intrare, în concordanță cu restricțiile specifice problemei. Pentru fiecare set de date se obține un anumit punctaj, în raport cu corectitudinea soluției tale.

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ă.