Detalii evaluare #49854940

Rezumat problemă

#821 CmmdcRec C++

Să se scrie o funcție C++ recursivă care returnează cel mai mare divizor comun a două numere transmise ca parametri.

Detalii

Problema CmmdcRec Operații I/O tastatură/ecran
Limita timp 0.1 secunde Limita memorie Total: 64 MB / Stivă 8 MB
Id soluție #49854940 Utilizator qwerty ytrewq (qwerty_1234)
Fișier cmmdcrec.cpp Dimensiune 8.05 KB
Data încărcării 17 Martie 2024, 22:08 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

cmmdcrec.cpp:63:5: error: redefinition of 'int n'
 int n,m, nrsel;

     ^
cmmdcrec.cpp:6:18: error: 'int n' previously declared here
 int T[1000001] , n , cer , m , t;

                  ^
cmmdcrec.cpp:63:7: error: redefinition of 'int m'
 int n,m, nrsel;

       ^
cmmdcrec.cpp:6:28: error: 'int m' previously declared here
 int T[1000001] , n , cer , m , t;

                            ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:76:5: error: redefinition of 'int main()'
 int main()

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp: At global scope:
cmmdcrec.cpp:112:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("festivaluri.in");

             ^
cmmdcrec.cpp:59:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("kruskal.in");

          ^
cmmdcrec.cpp:113:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("festivaluri.out");

              ^
cmmdcrec.cpp:60:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("kruskal.out");

          ^
cmmdcrec.cpp:114:5: error: redefinition of 'int n'
 int n,m,p,z,cnt,nr,enercons,r;

     ^
cmmdcrec.cpp:6:18: error: 'int n' previously declared here
 int T[1000001] , n , cer , m , t;

                  ^
cmmdcrec.cpp:114:7: error: redefinition of 'int m'
 int n,m,p,z,cnt,nr,enercons,r;

       ^
cmmdcrec.cpp:6:28: error: 'int m' previously declared here
 int T[1000001] , n , cer , m , t;

                            ^
cmmdcrec.cpp:116:15: error: conflicting declaration 'int a [1005][1005]'
 int a[MAX][MAX] ;//declararea matricii costurilor

               ^
cmmdcrec.cpp:66:5: error: 'a' has a previous declaration as 'int a [102]'
 int a[NMAX];//retin indicii muchiilor selectate

     ^
cmmdcrec.cpp: In function 'void citire()':
cmmdcrec.cpp:124:15: error: invalid types 'int[int]' for array subscript
         a[x][y]=co;

               ^
cmmdcrec.cpp: In function 'void roy()':
cmmdcrec.cpp:136:26: error: invalid types 'int[int]' for array subscript
                 if(a[i][k] && a[k][j] &&(a[i][k] + a[k][j] < a[i][j] || !a[i][j]) && i != j)

                          ^
cmmdcrec.cpp:136:37: error: invalid types 'int[int]' for array subscript
                 if(a[i][k] && a[k][j] &&(a[i][k] + a[k][j] < a[i][j] || !a[i][j]) && i != j)

                                     ^
cmmdcrec.cpp:136:48: error: invalid types 'int[int]' for array subscript
                 if(a[i][k] && a[k][j] &&(a[i][k] + a[k][j] < a[i][j] || !a[i][j]) && i != j)

                                                ^
cmmdcrec.cpp:136:58: error: invalid types 'int[int]' for array subscript
                 if(a[i][k] && a[k][j] &&(a[i][k] + a[k][j] < a[i][j] || !a[i][j]) && i != j)

                                                          ^
cmmdcrec.cpp:136:68: error: invalid types 'int[int]' for array subscript
                 if(a[i][k] && a[k][j] &&(a[i][k] + a[k][j] < a[i][j] || !a[i][j]) && i != j)

                                                                    ^
cmmdcrec.cpp:136:80: error: invalid types 'int[int]' for array subscript
                 if(a[i][k] && a[k][j] &&(a[i][k] + a[k][j] < a[i][j] || !a[i][j]) && i != j)

                                                                                ^
cmmdcrec.cpp:137:27: error: invalid types 'int[int]' for array subscript
                     a[i][j] = a[i][k] + a[k][j];

                           ^
cmmdcrec.cpp:137:37: error: invalid types 'int[int]' for array subscript
                     a[i][j] = a[i][k] + a[k][j];

                                     ^
cmmdcrec.cpp:137:47: error: invalid types 'int[int]' for array subscript
                     a[i][j] = a[i][k] + a[k][j];

                                               ^
cmmdcrec.cpp: In function 'void sortare()':
cmmdcrec.cpp:143:32: error: invalid types 'int[int]' for array subscript
         festsort[i]=a[z][fes[i]];

                                ^
cmmdcrec.cpp:140:9: warning: unused variable 'j' [-Wunused-variable]
 { int i,j;

         ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:156:5: error: redefinition of 'int main()'
 int main()

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp: At global scope:
cmmdcrec.cpp:166:5: error: redefinition of 'int n'
 int n, m, k, rez, w[5001];

     ^
cmmdcrec.cpp:6:18: error: 'int n' previously declared here
 int T[1000001] , n , cer , m , t;

                  ^
cmmdcrec.cpp:166:8: error: redefinition of 'int m'
 int n, m, k, rez, w[5001];

        ^
cmmdcrec.cpp:6:28: error: 'int m' previously declared here
 int T[1000001] , n , cer , m , t;

                            ^
cmmdcrec.cpp:167:8: error: redefinition of 'struct muchie'
 struct muchie

        ^
cmmdcrec.cpp:61:8: error: previous definition of 'struct muchie'
 struct muchie {int x,y,c;};

        ^
cmmdcrec.cpp:170:15: error: invalid type in declaration before ';' token
 } muchii[5001];

               ^
cmmdcrec.cpp: In function 'bool cmp(muchie, muchie)':
cmmdcrec.cpp:174:14: error: 'struct muchie' has no member named 'cost'
     return a.cost < b.cost;

              ^
cmmdcrec.cpp:174:23: error: 'struct muchie' has no member named 'cost'
     return a.cost < b.cost;

                       ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:176:5: error: redefinition of 'int main()'
 int main()

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp:180:37: error: cannot convert '<brace-enclosed initializer list>' to 'int' in assignment
         f >> a >> b >> x, muchii[i] = {a, b, x}, w[i] = i;

                                     ^
cmmdcrec.cpp:184:34: error: request for member 'cost' in 'muchii[x]', which is of non-class type 'int'
         f >> x, rez += muchii[x].cost;

                                  ^
cmmdcrec.cpp:185:31: error: request for member 'a' in 'muchii[x]', which is of non-class type 'int'
         int old = w[muchii[x].a], nou = w[muchii[x].b];

                               ^
cmmdcrec.cpp:188:24: error: 'nou' was not declared in this scope
                 w[i] = nou;

                        ^
cmmdcrec.cpp:192:25: error: request for member 'a' in 'muchii[index]', which is of non-class type 'int'
     if (w[muchii[index].a] != w[muchii[index].b]) {

                         ^
cmmdcrec.cpp:192:47: error: request for member 'b' in 'muchii[index]', which is of non-class type 'int'
     if (w[muchii[index].a] != w[muchii[index].b]) {

                                               ^
cmmdcrec.cpp:193:30: error: request for member 'cost' in 'muchii[index]', which is of non-class type 'int'
         rez += muchii[index].cost;

                              ^
cmmdcrec.cpp:194:35: error: request for member 'a' in 'muchii[index]', which is of non-class type 'int'
         int old = w[muchii[index].a], nou = w[muchii[index].b];

                                   ^
cmmdcrec.cpp:197:24: error: 'nou' was not declared in this scope
                 w[i] = nou;

                        ^
cmmdcrec.cpp: At global scope:
cmmdcrec.cpp:205:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("picard.in");

             ^
cmmdcrec.cpp:59:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("kruskal.in");

          ^
cmmdcrec.cpp:206:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("picard.out");

              ^
cmmdcrec.cpp:60:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("kruskal.out");

          ^
cmmdcrec.cpp:208:15: error: conflicting declaration 'int C [101][101]'
 int C[101][101],n,m,smax;

               ^
cmmdcrec.cpp:7:11: error: 'C' has a previous declaration as 'long long int C [1000001]'
 long long C[1000001];

           ^
cmmdcrec.cpp:208:17: error: redefinition of 'int n'
 int C[101][101],n,m,smax;

                 ^
cmmdcrec.cpp:6:18: error: 'int n' previously declared here
 int T[1000001] , n , cer , m , t;

                  ^
cmmdcrec.cpp:208:19: error: redefinition of 'int m'
 int C[101][101],n,m,smax;

                   ^
cmmdcrec.cpp:6:28: error: 'int m' previously declared here
 int T[1000001] , n , cer , m , t;

                            ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:209:5: error: redefinition of 'int main()'
 int main()

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp:214:28: error: invalid types 'long long int[int]' for array subscript
             if(i!=j) C[i][j]=inf;

                            ^
cmmdcrec.cpp:219:15: error: invalid types 'long long int[int]' for array subscript
         C[x][y]=C[y][x]=c;

               ^
cmmdcrec.cpp:219:23: error: invalid types 'long long int[int]' for array subscript
         C[x][y]=C[y][x]=c;

                       ^
cmmdcrec.cpp:224:26: error: invalid types 'long long int[int]' for array subscript
                 if(C[i][j]>C[i][k]+C[k][j])

                          ^
cmmdcrec.cpp:224:34: error: invalid types 'long long int[int]' for array subscript
                 if(C[i][j]>C[i][k]+C[k][j])

                                  ^
cmmdcrec.cpp:224:42: error: invalid types 'long long int[int]' for array subscript
                 if(C[i][j]>C[i][k]+C[k][j])

                                          ^
cmmdcrec.cpp:225:27: error: invalid types 'long long int[int]' for array subscript
                     C[i][j]=C[i][k]+C[k][j];

                           ^
cmmdcrec.cpp:225:35: error: invalid types 'long long int[int]' for array subscript
                     C[i][j]=C[i][k]+C[k][j];

                                   ^
cmmdcrec.cpp:225:43: error: invalid types 'long long int[int]' for array subscript
                     C[i][j]=C[i][k]+C[k][j];

                                           ^
cmmdcrec.cpp:230:23: error: invalid types 'long long int[int]' for array subscript
             s=s+C[i][j]

                       ^
cmmdcrec.cpp:231:9: error: expected ';' before 'if'
         if(s>smax)

         ^
cmmdcrec.cpp:238:23: error: invalid types 'long long int[int]' for array subscript
             s=s+C[i][j];

                       ^
cmmdcrec.cpp: At global scope:
cmmdcrec.cpp:248:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("dijkstra.in");

             ^
cmmdcrec.cpp:59:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("kruskal.in");

          ^
cmmdcrec.cpp:249:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("dijkstra.out");

              ^
cmmdcrec.cpp:60:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("kruskal.out");

          ^
cmmdcrec.cpp:250:5: error: redefinition of 'int n'
 int n,start,x,y,z;

     ^
cmmdcrec.cpp:6:18: error: 'int n' previously declared here
 int T[1000001] , n , cer , m , t;

                  ^
cmmdcrec.cpp:250:17: error: redefinition of 'int z'
 int n,start,x,y,z;

                 ^
cmmdcrec.cpp:114:11: error: 'int z' previously declared here
 int n,m,p,z,cnt,nr,enercons,r;

           ^
cmmdcrec.cpp:251:17: error: conflicting declaration 'int C [102][102]'
 int C[NMAX][NMAX];

                 ^
cmmdcrec.cpp:7:11: error: 'C' has a previous declaration as 'long long int C [1000001]'
 long long C[1000001];

           ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:260:5: error: redefinition of 'int main()'
 int main()

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp: In function 'void citire()':
cmmdcrec.cpp:267:6: error: redefinition of 'void citire()'
 void citire()

      ^
cmmdcrec.cpp:118:6: error: 'void citire()' previously defined here
 void citire()

      ^
cmmdcrec.cpp:273:37: error: invalid types 'long long int[int]' for array subscript
         for(j=i+1; j<=n; j++) C[i][j]=C[j][i]=INF;

                                     ^
cmmdcrec.cpp:273:45: error: invalid types 'long long int[int]' for array subscript
         for(j=i+1; j<=n; j++) C[i][j]=C[j][i]=INF;

                                             ^
cmmdcrec.cpp:275:15: error: invalid types 'long long int[int]' for array subscript
         C[i][j]=cost;

               ^
cmmdcrec.cpp: In function 'void dijkstra()':
cmmdcrec.cpp:285:27: error: invalid types 'long long int[int]' for array subscript
         cmin[i]=C[start][i];

                           ^
cmmdcrec.cpp:303:32: error: invalid types 'long long int[int]' for array subscript
         if(!uz[x] && C[vfmin][x]!=INF)

                                ^
cmmdcrec.cpp:304:44: error: invalid types 'long long int[int]' for array subscript
           if(cmin[x]>cmin[vfmin]+C[vfmin][x])

                                            ^
cmmdcrec.cpp:306:41: error: invalid types 'long long int[int]' for array subscript
           cmin[x]=cmin[vfmin]+C[vfmin][x];

                                         ^
cmmdcrec.cpp: At global scope:
cmmdcrec.cpp:337:13: error: redefinition of 'std::ifstream fin'
 ifstream fin("roy-floyd.in");

             ^
cmmdcrec.cpp:59:10: error: 'std::ifstream fin' previously declared here
 ifstream fin("kruskal.in");

          ^
cmmdcrec.cpp:338:14: error: redefinition of 'std::ofstream fout'
 ofstream fout("roy-floyd.out");

              ^
cmmdcrec.cpp:60:10: error: 'std::ofstream fout' previously declared here
 ofstream fout("kruskal.out");

          ^
cmmdcrec.cpp:340:5: error: redefinition of 'int n'
 int n,m,x,y,z;

     ^
cmmdcrec.cpp:6:18: error: 'int n' previously declared here
 int T[1000001] , n , cer , m , t;

                  ^
cmmdcrec.cpp:340:7: error: redefinition of 'int m'
 int n,m,x,y,z;

       ^
cmmdcrec.cpp:6:28: error: 'int m' previously declared here
 int T[1000001] , n , cer , m , t;

                            ^
cmmdcrec.cpp:340:9: error: redefinition of 'int x'
 int n,m,x,y,z;

         ^
cmmdcrec.cpp:250:13: error: 'int x' previously declared here
 int n,start,x,y,z;

             ^
cmmdcrec.cpp:340:11: error: redefinition of 'int y'
 int n,m,x,y,z;

           ^
cmmdcrec.cpp:250:15: error: 'int y' previously declared here
 int n,start,x,y,z;

               ^
cmmdcrec.cpp:340:13: error: redefinition of 'int z'
 int n,m,x,y,z;

             ^
cmmdcrec.cpp:114:11: error: 'int z' previously declared here
 int n,m,p,z,cnt,nr,enercons,r;

           ^
cmmdcrec.cpp:341:17: error: conflicting declaration 'int C [102][102]'
 int C[NMAX][NMAX];

                 ^
cmmdcrec.cpp:7:11: error: 'C' has a previous declaration as 'long long int C [1000001]'
 long long C[1000001];

           ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:342:5: error: redefinition of 'int main()'
 int main()

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp:348:27: error: invalid types 'long long int[int]' for array subscript
            if(i==j) C[i][j]=0;

                           ^
cmmdcrec.cpp:349:24: error: invalid types 'long long int[int]' for array subscript
             else C[i][j]=INF;

                        ^
cmmdcrec.cpp:353:20: error: invalid types 'long long int[int]' for array subscript
         fin>>C[x][y];

                    ^
cmmdcrec.cpp:358:26: error: invalid types 'long long int[int]' for array subscript
                 if(C[x][z]+C[z][y]<C[x][y])

                          ^
cmmdcrec.cpp:358:34: error: invalid types 'long long int[int]' for array subscript
                 if(C[x][z]+C[z][y]<C[x][y])

                                  ^
cmmdcrec.cpp:358:42: error: invalid types 'long long int[int]' for array subscript
                 if(C[x][z]+C[z][y]<C[x][y])

                                          ^
cmmdcrec.cpp:359:27: error: invalid types 'long long int[int]' for array subscript
                     C[x][y]=C[x][z]+C[z][y];

                           ^
cmmdcrec.cpp:359:35: error: invalid types 'long long int[int]' for array subscript
                     C[x][y]=C[x][z]+C[z][y];

                                   ^
cmmdcrec.cpp:359:43: error: invalid types 'long long int[int]' for array subscript
                     C[x][y]=C[x][z]+C[z][y];

                                           ^
cmmdcrec.cpp:364:21: error: invalid types 'long long int[int]' for array subscript
            if(C[i][j]!=INF) fout<<C[i][j]<<' ';

                     ^
cmmdcrec.cpp:364:41: error: invalid types 'long long int[int]' for array subscript
            if(C[i][j]!=INF) fout<<C[i][j]<<' ';

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

     ^
cmmdcrec.cpp:21:5: error: 'int main()' previously defined here
 int main()

     ^
cmmdcrec.cpp:374:22: error: 'cmmdc' was not declared in this scope
   cout << cmmdc(x , y) << endl;

                      ^
In file included from /usr/include/c++/4.8/algorithm:62:0,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64,
                 from cmmdcrec.cpp:4:
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = bool (*)(muchie, muchie)]':
/usr/include/c++/4.8/bits/stl_algo.h:2226:70:   required from 'void std::__final_insertion_sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:5500:55:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
cmmdcrec.cpp:190:41:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2159:29: error: could not convert '* __i' from 'int' to 'muchie'
    if (__comp(*__i, *__first))
                             ^
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = bool (*)(muchie, muchie)]':
/usr/include/c++/4.8/bits/stl_algo.h:5349:59:   required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:2332:68:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int*; _Size = int; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
cmmdcrec.cpp:190:41:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:1948:27: error: could not convert '* __i' from 'int' to 'muchie'
  if (__comp(*__i, *__first))
                           ^
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of 'void std::__move_median_to_first(_Iterator, _Iterator, _Iterator, _Iterator, _Compare) [with _Iterator = int*; _Compare = bool (*)(muchie, muchie)]':
/usr/include/c++/4.8/bits/stl_algo.h:2295:13:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:2337:62:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int*; _Size = int; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
cmmdcrec.cpp:190:41:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:114:28: error: could not convert '* __a' from 'int' to 'muchie'
       if (__comp(*__a, *__b))
                            ^
/usr/include/c++/4.8/bits/stl_algo.h:116:25: error: could not convert '* __b' from 'int' to 'muchie'
    if (__comp(*__b, *__c))
                         ^
/usr/include/c++/4.8/bits/stl_algo.h:118:30: error: could not convert '* __a' from 'int' to 'muchie'
    else if (__comp(*__a, *__c))
                              ^
/usr/include/c++/4.8/bits/stl_algo.h:123:33: error: could not convert '* __a' from 'int' to 'muchie'
       else if (__comp(*__a, *__c))
                                 ^
/usr/include/c++/4.8/bits/stl_algo.h:125:33: error: could not convert '* __b' from 'int' to 'muchie'
       else if (__comp(*__b, *__c))
                                 ^
/usr/include/c++/4.8/bits/stl_algo.h: In instantiation of '_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = int*; _Tp = int; _Compare = bool (*)(muchie, muchie)]':
/usr/include/c++/4.8/bits/stl_algo.h:2296:78:   required from '_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:2337:62:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int*; _Size = int; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
cmmdcrec.cpp:190:41:   required from here
/usr/include/c++/4.8/bits/stl_algo.h:2263:35: error: could not convert '* __first' from 'int' to 'muchie'
    while (__comp(*__first, __pivot))
                                   ^
/usr/include/c++/4.8/bits/stl_algo.h:2266:34: error: could not convert '__pivot' from 'const int' to 'muchie'
    while (__comp(__pivot, *__last))
                                  ^
In file included from /usr/include/c++/4.8/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.8/algorithm:62,
                 from /usr/include/i386-linux-gnu/c++/4.8/bits/stdc++.h:64,
                 from cmmdcrec.cpp:4:
/usr/include/c++/4.8/bits/stl_heap.h: In instantiation of 'void std::__adjust_heap(_RandomAccessIterator, _Distance, _Distance, _Tp, _Compare) [with _RandomAccessIterator = int*; _Distance = int; _Tp = int; _Compare = bool (*)(muchie, muchie)]':
/usr/include/c++/4.8/bits/stl_heap.h:448:15:   required from 'void std::make_heap(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:1946:47:   required from 'void std::__heap_select(_RandomAccessIterator, _RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:5349:59:   required from 'void std::partial_sort(_RAIter, _RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:2332:68:   required from 'void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = int*; _Size = int; _Compare = bool (*)(muchie, muchie)]'
/usr/include/c++/4.8/bits/stl_algo.h:5499:44:   required from 'void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = int*; _Compare = bool (*)(muchie, muchie)]'
cmmdcrec.cpp:190:41:   required from here
/usr/include/c++/4.8/bits/stl_heap.h:313:40: error: could not convert '*(__first + ((sizetype)(((unsigned int)__secondChild) * 4u)))' from 'int' to 'muchie'
        *(__first + (__secondChild - 1))))
                                        ^
cmmdcrec.cpp: In function 'int main()':
cmmdcrec.cpp:23:40: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("episodul1.in", "r", stdin);

                                        ^
cmmdcrec.cpp:24:42: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
     freopen("episodul1.out", "w", stdout);

                                          ^
cmmdcrec.cpp: In function 'bool cmp(muchie, muchie)':
cmmdcrec.cpp:175:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

 ^

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 CmmdcRec face parte din a doua categorie. Pentru aceste probleme se folosește un program suport, furnizat de propunătorul problemei. Soluția propusă de tine va fi evaluată astfel:

  • Soluția propusă de tine este inclusă în programul suport, apoi acesta este compilat. Dacă în urma compilării se obțin erori sau avertismente, acestea sunt afișate în această pagină.
  • Datorită existenței programului suport, la compilare pot să apară erori sau avertismente care să nu se refere la instrucțiunile scrise de tine, dar care sunt datorate faptului că soluția ta nu este corectă.
  • Dacă programul suport 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ă.