Detalii evaluare #15528526

Rezumat problemă

#2539 flori4

Compania lui Jimmy are n plantații cu flori. Pentru fiecare plantație se cunoaște tipul florilor cultivate, respectiv câte tone de flori au fost produse anul acesta. Se cunoaște că plantațiile cu flori sunt conectate prin n - 1 drumuri astfel încât la fiecare plantație se poate ajunge de la oricare altă plantație și există un singur mod de ajunge de la plantația x la plantația y , pentru fiecare 1 ≤ x, y ≤ n. De asemenea, știm și distanța în km pentru fiecare dintre cele n - 1 drumuri. Jimmy vrea să aducă toate florile de același tip în același loc, cu cost minim de transport. Dacă avem a tone de flori şi vrem să le trimitem pe o distanță de b kilometri, costul transportului este a * b. Pentru fiecare tip de floare Jimmy vrea să determine costul minim de transport pentru a aduce toate florile de același tip la un loc.

Olimpiada internațională pe Echipe, 2018

Detalii

Problema flori4 Operații I/O tastatură/ecran
Limita timp 2 secunde Limita memorie Total: 32 MB / Stivă 8 MB
Id soluție #15528526 Utilizator Adrian Vasile (Micutu)
Fișier flori4.cpp Dimensiune 4.56 KB
Data încărcării 19 Aprilie 2019, 20:18 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

flori4.cpp:104:2: error: stray '#' in program
 }#include <bits/stdc++.h>

  ^
flori4.cpp: In function 'void dfs(long long int)':
flori4.cpp:21:19: warning: unused variable 'cost' [-Wunused-variable]
         long long cost = L[nod][i].second;

                   ^
flori4.cpp: In function 'void dfs2(long long int, long long int, long long int)':
flori4.cpp:52:51: warning: array subscript has type 'char' [-Wchar-subscripts]
         J[nod] = J[tata] - S[nod] * cst + (Total[C] - S[nod]) * cst;

                                                   ^
flori4.cpp: In function 'int main()':
flori4.cpp:76:19: warning: array subscript has type 'char' [-Wchar-subscripts]
         Total[t[i]] += v[i];

                   ^
flori4.cpp:87:20: warning: array subscript has type 'char' [-Wchar-subscripts]
         if (Total[C] == 0) {

                    ^
flori4.cpp:88:18: warning: array subscript has type 'char' [-Wchar-subscripts]
             Sol[C] = 0;

                  ^
flori4.cpp:96:14: warning: array subscript has type 'char' [-Wchar-subscripts]
         Sol[C] = sol;

              ^
flori4.cpp: At global scope:
flori4.cpp:104:3: error: 'include' does not name a type
 }#include <bits/stdc++.h>

   ^
flori4.cpp:109:44: error: redefinition of 'std::vector<std::pair<long long int, long long int> > L [200010]'
 vector < pair<long long, long long> > L[DIM];

                                            ^
flori4.cpp:6:39: error: 'std::vector<std::pair<long long int, long long int> > L [200010]' previously declared here
 vector < pair<long long, long long> > L[DIM];

                                       ^
flori4.cpp:110:11: error: redefinition of 'char t [200010]'
 char t[DIM], C;

           ^
flori4.cpp:7:6: error: 'char t [200010]' previously declared here
 char t[DIM], C;

      ^
flori4.cpp:110:14: error: redefinition of 'char C'
 char t[DIM], C;

              ^
flori4.cpp:7:14: error: 'char C' previously declared here
 char t[DIM], C;

              ^
flori4.cpp:111:16: error: redefinition of 'long long int v [200010]'
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                ^
flori4.cpp:8:11: error: 'long long int v [200010]' previously declared here
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

           ^
flori4.cpp:111:27: error: redefinition of 'long long int D [200010][2]'
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                           ^
flori4.cpp:8:19: error: 'long long int D [200010][2]' previously declared here
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                   ^
flori4.cpp:111:37: error: redefinition of 'long long int Sol [200010]'
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                                     ^
flori4.cpp:8:30: error: 'long long int Sol [200010]' previously declared here
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                              ^
flori4.cpp:111:45: error: redefinition of 'long long int S [200010]'
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                                             ^
flori4.cpp:8:40: error: 'long long int S [200010]' previously declared here
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                                        ^
flori4.cpp:111:53: error: redefinition of 'long long int J [200010]'
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                                                     ^
flori4.cpp:8:48: error: 'long long int J [200010]' previously declared here
 long long v[DIM], D[DIM][2], Sol[DIM], S[DIM], J[DIM];

                                                ^
flori4.cpp:112:14: error: redefinition of 'std::bitset<200010u> f'
 bitset <DIM> f;

              ^
flori4.cpp:9:14: error: 'std::bitset<200010u> f' previously defined here
 bitset <DIM> f;

              ^
flori4.cpp:113:11: error: redefinition of 'long long int n'
 long long n, i, x, y, c, sol;

           ^
flori4.cpp:10:11: error: 'long long int n' previously declared here
 long long n, i, x, y, c, sol;

           ^
flori4.cpp:113:14: error: redefinition of 'long long int i'
 long long n, i, x, y, c, sol;

              ^
flori4.cpp:10:14: error: 'long long int i' previously declared here
 long long n, i, x, y, c, sol;

              ^
flori4.cpp:113:17: error: redefinition of 'long long int x'
 long long n, i, x, y, c, sol;

                 ^
flori4.cpp:10:17: error: 'long long int x' previously declared here
 long long n, i, x, y, c, sol;

                 ^
flori4.cpp:113:20: error: redefinition of 'long long int y'
 long long n, i, x, y, c, sol;

                    ^
flori4.cpp:10:20: error: 'long long int y' previously declared here
 long long n, i, x, y, c, sol;

                    ^
flori4.cpp:113:23: error: redefinition of 'long long int c'
 long long n, i, x, y, c, sol;

                       ^
flori4.cpp:10:23: error: 'long long int c' previously declared here
 long long n, i, x, y, c, sol;

                       ^
flori4.cpp:113:26: error: redefinition of 'long long int sol'
 long long n, i, x, y, c, sol;

                          ^
flori4.cpp:10:26: error: 'long long int sol' previously declared here
 long long n, i, x, y, c, sol;

                          ^
flori4.cpp:114:20: error: redefinition of 'long long int Total [130]'
 long long Total[130];

                    ^
flori4.cpp:11:11: error: 'long long int Total [130]' previously declared here
 long long Total[130];

           ^
flori4.cpp: In function 'void dfs(long long int)':
flori4.cpp:116:6: error: redefinition of 'void dfs(long long int)'
 void dfs(long long nod) {

      ^
flori4.cpp:13:6: error: 'void dfs(long long int)' previously defined here
 void dfs(long long nod) {

      ^
flori4.cpp:124:19: warning: unused variable 'cost' [-Wunused-variable]
         long long cost = L[nod][i].second;

                   ^
flori4.cpp: In function 'void dfs1(long long int)':
flori4.cpp:133:6: error: redefinition of 'void dfs1(long long int)'
 void dfs1(long long nod) {

      ^
flori4.cpp:30:6: error: 'void dfs1(long long int)' previously defined here
 void dfs1(long long nod) {

      ^
flori4.cpp: In function 'void dfs2(long long int, long long int, long long int)':
flori4.cpp:152:6: error: redefinition of 'void dfs2(long long int, long long int, long long int)'
 void dfs2(long long nod, long long tata, long long cst) {

      ^
flori4.cpp:49:6: error: 'void dfs2(long long int, long long int, long long int)' previously defined here
 void dfs2(long long nod, long long tata, long long cst) {

      ^
flori4.cpp:155:51: warning: array subscript has type 'char' [-Wchar-subscripts]
         J[nod] = J[tata] - S[nod] * cst + (Total[C] - S[nod]) * cst;

                                                   ^
flori4.cpp: In function 'int main()':
flori4.cpp:169:5: error: redefinition of 'int main()'
 int main () {

     ^
flori4.cpp:66:5: error: 'int main()' previously defined here
 int main () {

     ^
flori4.cpp:179:19: warning: array subscript has type 'char' [-Wchar-subscripts]
         Total[t[i]] += v[i];

                   ^
flori4.cpp:190:20: warning: array subscript has type 'char' [-Wchar-subscripts]
         if (Total[C] == 0) {

                    ^
flori4.cpp:191:18: warning: array subscript has type 'char' [-Wchar-subscripts]
             Sol[C] = 0;

                  ^
flori4.cpp:199:14: warning: array subscript has type 'char' [-Wchar-subscripts]
         Sol[C] = sol;

              ^

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