#4148
Se dau n
numere naturale, reprezentând elementele unui vector. Determinați lungimea maximă a unei secvențe de elemente divizibile cu 10
, precum și numărul de secvențe de lungime maximă cu elemente divizibile cu 10
.
Problema | Secv10 | Operații I/O |
![]() secv10.in /secv10.out
|
---|---|---|---|
Limita timp | 0.1 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #58384005 | Utilizator | |
Fișier | secv10.c | Dimensiune | 725 B |
Data încărcării | 30 Mai 2025, 18:23 | Scor / rezultat | 0 puncte |
secv10.c: In function 'main': secv10.c:12:5: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d", &n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from secv10.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ secv10.c:12:5: warning: passing argument 2 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d", &n); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from secv10.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ secv10.c:12:5: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%d", &n); ^ secv10.c:18:9: warning: passing argument 1 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d", &v[i]); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from secv10.c:1: /usr/include/stdio.h:443:12: note: expected 'struct FILE * restrict' but argument is of type 'char *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ secv10.c:18:9: warning: passing argument 2 of 'fscanf' from incompatible pointer type [enabled by default] fscanf("%d", &v[i]); ^ In file included from /usr/include/features.h:374:0, from /usr/include/stdio.h:27, from secv10.c:1: /usr/include/stdio.h:443:12: note: expected 'const char * restrict' but argument is of type 'int *' extern int __REDIRECT (fscanf, (FILE *__restrict __stream, ^ secv10.c:18:9: warning: format not a string literal and no format arguments [-Wformat-security] fscanf("%d", &v[i]); ^ secv10.c:36:5: warning: passing argument 1 of 'fprintf' from incompatible pointer type [enabled by default] fprintf("%d%d", contor, cbc); ^ In file included from /usr/include/stdio.h:937:0, from secv10.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: note: expected 'struct FILE * restrict' but argument is of type 'char *' fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ secv10.c:36:5: warning: passing argument 2 of 'fprintf' makes pointer from integer without a cast [enabled by default] fprintf("%d%d", contor, cbc); ^ In file included from /usr/include/stdio.h:937:0, from secv10.c:1: /usr/include/i386-linux-gnu/bits/stdio2.h:95:1: note: expected 'const char * restrict' but argument is of type 'int' fprintf (FILE *__restrict __stream, const char *__restrict __fmt, ...) ^ secv10.c:12:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%d", &n); ^ secv10.c:18:15: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf("%d", &v[i]); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
1 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
2 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
3 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
4 | 0 secunde | Caught fatal signal 11 | 20 | 0 | ||
5 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
6 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
7 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
8 | 0 secunde | Caught fatal signal 11 | 10 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Secv10 face parte din prima categorie. Soluția propusă de tine va fi evaluată astfel:
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ă.