Detalii evaluare #54951047

Rezumat problemă

Se dau două şiruri a şi b, cu n, respectiv m elemente, numere naturale, ordonate crescător. Să se construiască un al treilea şir, c, care să conţină, în ordine crescătoare, elementele din şirurile a şi b.

Detalii

Problema Interclasare Operații I/O interclasare.in/interclasare.out
Limita timp 0.5 secunde Limita memorie Total: 64 MB / Stivă 32 MB
Id soluție #54951047 Utilizator Mesina Cezar (cezarcezar)
Fișier interclasare.c Dimensiune 1.34 KB
Data încărcării 13 Decembrie 2024, 10:54 Scor / rezultat Eroare de compilare

Evaluare


Mesaj compilare

interclasare.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
 include <stdio.h>

         ^
In file included from interclasare.c:2:0:
/usr/include/stdlib.h:139:1: error: unknown type name 'size_t'
 extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
 ^
/usr/include/stdlib.h:466:22: error: unknown type name 'size_t'
 extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
                      ^
/usr/include/stdlib.h:468:22: error: unknown type name 'size_t'
 extern void *calloc (size_t __nmemb, size_t __size)
                      ^
/usr/include/stdlib.h:468:38: error: unknown type name 'size_t'
 extern void *calloc (size_t __nmemb, size_t __size)
                                      ^
/usr/include/stdlib.h:480:36: error: unknown type name 'size_t'
 extern void *realloc (void *__ptr, size_t __size)
                                    ^
/usr/include/stdlib.h:756:9: error: unknown type name 'size_t'
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
         ^
/usr/include/stdlib.h:756:25: error: unknown type name 'size_t'
         size_t __nmemb, size_t __size, __compar_fn_t __compar)
                         ^
In file included from /usr/include/stdlib.h:760:0,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:49: error: unknown type name 'size_t'
 bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
                                                 ^
/usr/include/i386-linux-gnu/bits/stdlib-bsearch.h:20:65: error: unknown type name 'size_t'
 bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size,
                                                                 ^
In file included from interclasare.c:2:0:
/usr/include/stdlib.h:765:34: error: unknown type name 'size_t'
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                  ^
/usr/include/stdlib.h:765:50: error: unknown type name 'size_t'
 extern void qsort (void *__base, size_t __nmemb, size_t __size,
                                                  ^
/usr/include/stdlib.h:863:36: error: unknown type name 'size_t'
 extern int mblen (const char *__s, size_t __n) __THROW;
                                    ^
/usr/include/stdlib.h:867:34: error: unknown type name 'size_t'
      const char *__restrict __s, size_t __n) __THROW;
                                  ^
/usr/include/stdlib.h:874:1: error: unknown type name 'size_t'
 extern size_t mbstowcs (wchar_t *__restrict  __pwcs,
 ^
/usr/include/stdlib.h:875:32: error: unknown type name 'size_t'
    const char *__restrict __s, size_t __n) __THROW;
                                ^
/usr/include/stdlib.h:877:1: error: unknown type name 'size_t'
 extern size_t wcstombs (char *__restrict __s,
 ^
/usr/include/stdlib.h:878:38: error: unknown type name 'size_t'
    const wchar_t *__restrict __pwcs, size_t __n)
                                      ^
In file included from /usr/include/stdlib.h:959:0,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:25:9: error: unknown type name 'size_t'
         size_t __resolvedlen) __THROW __wur;
         ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdlib.h:24,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:29:14: error: unknown type name 'size_t'
 extern char *__REDIRECT_NTH (__realpath_chk_warn,
              ^
In file included from /usr/include/stdlib.h:959:0,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h: In function 'realpath':
/usr/include/i386-linux-gnu/bits/stdlib.h:39:30: error: 'size_t' undeclared (first use in this function)
   if (__bos (__resolved) != (size_t) -1)
                              ^
/usr/include/i386-linux-gnu/bits/stdlib.h:39:30: note: each undeclared identifier is reported only once for each function it appears in
/usr/include/i386-linux-gnu/bits/stdlib.h: At top level:
/usr/include/i386-linux-gnu/bits/stdlib.h:52:52: error: unknown type name 'size_t'
 extern int __ptsname_r_chk (int __fd, char *__buf, size_t __buflen,
                                                    ^
/usr/include/i386-linux-gnu/bits/stdlib.h:53:8: error: unknown type name 'size_t'
        size_t __nreal) __THROW __nonnull ((2));
        ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdlib.h:24,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:54:12: error: unknown type name 'size_t'
 extern int __REDIRECT_NTH (__ptsname_r_alias, (int __fd, char *__buf,
            ^
/usr/include/i386-linux-gnu/bits/stdlib.h:57:12: error: unknown type name 'size_t'
 extern int __REDIRECT_NTH (__ptsname_r_chk_warn,
            ^
/usr/include/i386-linux-gnu/bits/stdlib.h:57:12: error: unknown type name 'size_t'
 extern int __REDIRECT_NTH (__ptsname_r_chk_warn,
            ^
/usr/include/i386-linux-gnu/bits/stdlib.h:64:1: error: unknown type name 'size_t'
 __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
 ^
In file included from /usr/include/stdlib.h:959:0,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:77:54: error: unknown type name 'size_t'
 extern int __wctomb_chk (char *__s, wchar_t __wchar, size_t __buflen)
                                                      ^
/usr/include/i386-linux-gnu/bits/stdlib.h: In function 'wctomb':
/usr/include/i386-linux-gnu/bits/stdlib.h:92:23: error: 'size_t' undeclared (first use in this function)
   if (__bos (__s) != (size_t) -1 && __STDLIB_MB_LEN_MAX > __bos (__s))
                       ^
/usr/include/i386-linux-gnu/bits/stdlib.h: At top level:
/usr/include/i386-linux-gnu/bits/stdlib.h:98:1: error: unknown type name 'size_t'
 extern size_t __mbstowcs_chk (wchar_t *__restrict __dst,
 ^
/usr/include/i386-linux-gnu/bits/stdlib.h:100:10: error: unknown type name 'size_t'
          size_t __len, size_t __dstlen) __THROW;
          ^
/usr/include/i386-linux-gnu/bits/stdlib.h:100:24: error: unknown type name 'size_t'
          size_t __len, size_t __dstlen) __THROW;
                        ^
/usr/include/i386-linux-gnu/bits/stdlib.h:101:1: error: unknown type name 'size_t'
 extern size_t __REDIRECT_NTH (__mbstowcs_alias,
 ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdlib.h:24,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:101:15: error: unknown type name 'size_t'
 extern size_t __REDIRECT_NTH (__mbstowcs_alias,
               ^
In file included from /usr/include/stdlib.h:959:0,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:105:1: error: unknown type name 'size_t'
 extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
 ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdlib.h:24,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:105:15: error: unknown type name 'size_t'
 extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
               ^
/usr/include/i386-linux-gnu/bits/stdlib.h:105:15: error: unknown type name 'size_t'
 extern size_t __REDIRECT_NTH (__mbstowcs_chk_warn,
               ^
/usr/include/i386-linux-gnu/bits/stdlib.h:113:1: error: expected ',' or ';' before 'mbstowcs'
 __NTH (mbstowcs (wchar_t *__restrict __dst, const char *__restrict __src,
 ^
In file included from /usr/include/stdlib.h:959:0,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:130:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_chk'
 extern size_t __wcstombs_chk (char *__restrict __dst,
               ^
In file included from /usr/include/features.h:374:0,
                 from /usr/include/stdlib.h:24,
                 from interclasare.c:2:
/usr/include/i386-linux-gnu/bits/stdlib.h:133:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_alias'
 extern size_t __REDIRECT_NTH (__wcstombs_alias,
               ^
/usr/include/i386-linux-gnu/bits/stdlib.h:137:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__wcstombs_chk_warn'
 extern size_t __REDIRECT_NTH (__wcstombs_chk_warn,
               ^
/usr/include/i386-linux-gnu/bits/stdlib.h:144:1: error: expected ',' or ';' before 'wcstombs'
 __NTH (wcstombs (char *__restrict __dst, const wchar_t *__restrict __src,
 ^
interclasare.c: In function 'main':
interclasare.c:4:2: error: unknown type name 'FILE'
 {FILE *fin, *fout;

  ^
interclasare.c:6:5: warning: implicit declaration of function 'fopen' [-Wimplicit-function-declaration]
     fin=fopen("interclasare.in","r");

     ^
interclasare.c:6:8: warning: assignment makes pointer from integer without a cast [enabled by default]
     fin=fopen("interclasare.in","r");

        ^
interclasare.c:7:9: warning: assignment makes pointer from integer without a cast [enabled by default]
     fout=fopen("interclasare.out","w");

         ^
interclasare.c:8:5: warning: implicit declaration of function 'fscanf' [-Wimplicit-function-declaration]
     fscanf(fin,"%d%d%lld",&n);

     ^
interclasare.c:8:5: warning: incompatible implicit declaration of built-in function 'fscanf' [enabled by default]
interclasare.c:8:5: warning: format '%d' expects a matching 'int *' argument [-Wformat=]
interclasare.c:8:5: warning: format '%lld' expects a matching 'long long int *' argument [-Wformat=]
interclasare.c:11:8: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'int' [-Wformat=]
        fscanf(fin,"%d%d%lld",v1[i]);

        ^
interclasare.c:11:8: warning: format '%d' expects a matching 'int *' argument [-Wformat=]
interclasare.c:11:8: warning: format '%lld' expects a matching 'long long int *' argument [-Wformat=]
interclasare.c:12:5: warning: format '%d' expects a matching 'int *' argument [-Wformat=]
     fscanf(fin,"%d%d%lld",&m);

     ^
interclasare.c:12:5: warning: format '%lld' expects a matching 'long long int *' argument [-Wformat=]
interclasare.c:15:8: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'int' [-Wformat=]
        fscanf(fin,"%d%d%lld",v2[m]);

        ^
interclasare.c:15:8: warning: format '%d' expects a matching 'int *' argument [-Wformat=]
interclasare.c:15:8: warning: format '%lld' expects a matching 'long long int *' argument [-Wformat=]
interclasare.c:42:5: warning: implicit declaration of function 'fprintf' [-Wimplicit-function-declaration]
     fprintf(fout,"%d",v3[i]);

     ^
interclasare.c:42:5: warning: incompatible implicit declaration of built-in function 'fprintf' [enabled by default]
interclasare.c:43:3: warning: implicit declaration of function 'fclose' [-Wimplicit-function-declaration]
   fclose(fin);

   ^
interclasare.c:5:18: warning: variable 'n3' set but not used [-Wunused-but-set-variable]
   int j,n,i,m,n1,n3,n2,i1,i2,i3;

                  ^
interclasare.c:5:7: warning: unused variable 'j' [-Wunused-variable]
   int j,n,i,m,n1,n3,n2,i1,i2,i3;

       ^

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