#1102
Bile2
Pe o masă cad n
bile săltăreţe. Fiecare este lăsată să cadă liber de la o înălţime h
, diferită pentru fiecare bilă. Toate bilele cad simultan, cu o viteză constantă (1m/s)
.
Dându-se h
şi k
pentru fiecare dintre cele n
bile, să se răspundă la m
întrebări de forma: La ce înălţime faţă de masă se va afla bila x
în momentul t
?
Problema | Bile2 | Operații I/O |
bile2.in /bile2.out
|
---|---|---|---|
Limita timp | 0.3 secunde | Limita memorie |
Total: 32 MB
/
Stivă 4 MB
|
Id soluție | #3921769 | Utilizator | |
Fișier | bile2.cpp | Dimensiune | 826 B |
Data încărcării | 26 Decembrie 2016, 20:52 | Scor / rezultat | Eroare de compilare |
bile2.cpp: In function 'int main()': bile2.cpp:13:24: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long int*' [-Wformat=] fscanf(in,"%d %d",&n,&m); ^ bile2.cpp:13:24: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long int*' [-Wformat=] bile2.cpp:16:24: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long int*' [-Wformat=] fscanf(in,"%d %d",&a,&b); ^ bile2.cpp:16:24: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long int*' [-Wformat=] bile2.cpp:22:28: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long int*' [-Wformat=] fscanf(in,"%d %d",&x,&t) ^ bile2.cpp:22:28: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long int*' [-Wformat=] bile2.cpp:23:7: error: expected ';' before 'ch' ch=h[x]; ^ bile2.cpp:26:36: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=] fprintf(out,"%d\n",ch-t); ^ bile2.cpp:39:37: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=] if(contor%2==1) fprintf(out,"%d\n",t); ^ bile2.cpp:40:29: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=] else fprintf(out,"%d\n",ch-t); ^ bile2.cpp:13:25: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(in,"%d %d",&n,&m); ^ bile2.cpp:16:25: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] fscanf(in,"%d %d",&a,&b); ^ bile2.cpp:23:14: warning: ignoring return value of 'int fscanf(FILE*, const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] ch=h[x]; ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Bile2 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ă.