Detalii evaluare #64556981

Rezumat problemă

#1551

Se dă mulțimea V a arcelor unui graf orientat cu n vârfuri.
Să se determine drumul simplu de lungime maximă cu extremitatea inițială în vârful p din graf.

Detalii

Problema DSLM Operații I/O dslm.in/dslm.out
Limita timp 0.1 secunde Limita memorie Total: 2 MB / Stivă 2 MB
Id soluție #64556981 Utilizator Codreanu Andreea (andreea_cod)
Fișier dslm.cpp Dimensiune 1.33 KB
Data încărcării 14 Mai 2026, 10:23 Scor/rezultat Eroare de compilare

Evaluare

Mesaj compilare

In file included from /usr/include/c++/13/bits/requires_hosted.h:31,
                 from /usr/include/c++/13/iostream:38,
                 from dslm.cpp:1:
/usr/include/c++/13/bits/codecvt.h: In function ‘void updateBest()’:
/usr/include/c++/13/bits/codecvt.h:44:15: error: expected ‘=’ before ‘__attribute__’
   44 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/codecvt.h:44:15: error: expected identifier before ‘__attribute__’
In file included from /usr/include/c++/13/fstream:42,
                 from dslm.cpp:28:
/usr/include/c++/13/bits/codecvt.h:44:14: error: expected ‘;’ before ‘__attribute__’
   44 | namespace std _GLIBCXX_VISIBILITY(default)
      |              ^
      |              ;
dslm.cpp:27:18: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   27 |             else if(path[i] > best[i])
      |                  ^~
/usr/include/c++/13/bits/codecvt.h:44:15: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   44 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/codecvt.h:45:1: error: expected primary-expression before ‘{’ token
   45 | {
      | ^
/usr/include/x86_64-linux-gnu/c++/13/bits/c++io.h:38:15: error: expected ‘=’ before ‘__attribute__’
   38 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/13/bits/c++io.h:38:15: error: expected identifier before ‘__attribute__’
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/basic_file.h:40,
                 from /usr/include/c++/13/fstream:44:
/usr/include/x86_64-linux-gnu/c++/13/bits/c++io.h:38:14: error: expected ‘;’ before ‘__attribute__’
   38 | namespace std _GLIBCXX_VISIBILITY(default)
      |              ^
      |              ;
/usr/include/x86_64-linux-gnu/c++/13/bits/c++io.h:39:1: error: expected primary-expression before ‘{’ token
   39 | {
      | ^
/usr/include/x86_64-linux-gnu/c++/13/bits/basic_file.h:44:15: error: expected ‘=’ before ‘__attribute__’
   44 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/c++/13/bits/basic_file.h:44:15: error: expected identifier before ‘__attribute__’
/usr/include/x86_64-linux-gnu/c++/13/bits/basic_file.h:44:14: error: expected ‘;’ before ‘__attribute__’
   44 | namespace std _GLIBCXX_VISIBILITY(default)
      |              ^
      |              ;
/usr/include/x86_64-linux-gnu/c++/13/bits/basic_file.h:45:1: error: expected primary-expression before ‘{’ token
   45 | {
      | ^
/usr/include/c++/13/fstream:54:15: error: expected ‘=’ before ‘__attribute__’
   54 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/fstream:54:15: error: expected identifier before ‘__attribute__’
/usr/include/c++/13/fstream:54:14: error: expected ‘;’ before ‘__attribute__’
   54 | namespace std _GLIBCXX_VISIBILITY(default)
      |              ^
      |              ;
/usr/include/c++/13/fstream:55:1: error: expected primary-expression before ‘{’ token
   55 | {
      | ^
/usr/include/c++/13/bits/fstream.tcc:43:15: error: expected ‘=’ before ‘__attribute__’
   43 | namespace std _GLIBCXX_VISIBILITY(default)
      |               ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/fstream.tcc:43:15: error: expected identifier before ‘__attribute__’
In file included from /usr/include/c++/13/fstream:1300:
/usr/include/c++/13/bits/fstream.tcc:43:14: error: expected ‘;’ before ‘__attribute__’
   43 | namespace std _GLIBCXX_VISIBILITY(default)
      |              ^
      |              ;
/usr/include/c++/13/bits/fstream.tcc:44:1: error: expected primary-expression before ‘{’ token
   44 | {
      | ^
dslm.cpp:30:11: error: variable ‘std::ifstream f’ has initializer but incomplete type
   30 | ifstream f("dslm.in");
      |           ^
dslm.cpp:31:11: error: variable ‘std::ofstream g’ has initializer but incomplete type
   31 | ofstream g("dslm.out");
      |           ^
dslm.cpp:34:1: error: a function-definition is not allowed here before ‘{’ token
   34 | {
      | ^
dslm.cpp:41:1: error: a function-definition is not allowed here before ‘{’ token
   41 | {
      | ^
dslm.cpp:46:1: error: a function-definition is not allowed here before ‘{’ token
   46 | {
      | ^
dslm.cpp:52:1: error: a function-definition is not allowed here before ‘{’ token
   52 | {
      | ^
dslm.cpp:66:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   66 | int main()
      |         ^~
dslm.cpp:66:9: note: remove parentheses to default-initialize a variable
   66 | int main()
      |         ^~
      |         --
dslm.cpp:66:9: note: or replace parentheses with braces to value-initialize a variable
dslm.cpp:67:1: error: a function-definition is not allowed here before ‘{’ token
   67 | {
      | ^
dslm.cpp:72:2: error: expected ‘}’ at end of input
   72 | }
      |  ^
dslm.cpp:21:43: note: to match this ‘{’
   21 |         for(int i = 1; i <= lenPath; i++) {
      |                                           ^
dslm.cpp:32:5: warning: unused variable ‘a’ [-Wunused-variable]
   32 | int a[21][21],n,p, d[100], dmax[100],lgmax;
      |     ^
dslm.cpp:32:15: warning: unused variable ‘n’ [-Wunused-variable]
   32 | int a[21][21],n,p, d[100], dmax[100],lgmax;
      |               ^
dslm.cpp:32:17: warning: unused variable ‘p’ [-Wunused-variable]
   32 | int a[21][21],n,p, d[100], dmax[100],lgmax;
      |                 ^
dslm.cpp:32:20: warning: unused variable ‘d’ [-Wunused-variable]
   32 | int a[21][21],n,p, d[100], dmax[100],lgmax;
      |                    ^
dslm.cpp:32:28: warning: unused variable ‘dmax’ [-Wunused-variable]
   32 | int a[21][21],n,p, d[100], dmax[100],lgmax;
      |                            ^~~~
dslm.cpp:32:38: warning: unused variable ‘lgmax’ [-Wunused-variable]
   32 | int a[21][21],n,p, d[100], dmax[100],lgmax;
      |                                      ^~~~~
dslm.cpp:72:2: error: expected ‘}’ at end of input
   72 | }
      |  ^
dslm.cpp:19:33: note: to match this ‘{’
   19 |     else if(lenPath == lenBest) {
      |                                 ^
dslm.cpp:72:2: error: expected ‘}’ at end of input
   72 | }
      |  ^
dslm.cpp:11:19: note: to match this ‘{’
   11 | void updateBest() {
      |                   ^

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

Du-te sus!