#2785
galeti
n
găleți numerotate de la stânga la dreapta numere de la 1
la n
. Fiecare găleată conține inițial 1
litru de apă. Capacitatea fiecărei găleți se consideră nelimitată. Vărsăm gălețile una în alta, respectând o anumită regulă, până când toată apa ajunge în prima găleată din stânga. Vărsarea unei găleți presupune un anumit efort. Cunoscând numărul de găleți n
și un număr natural e
, să se determine o succesiune de vărsări în urma căreia toată apa ajunge în găleata cea mai din stânga și efortul total depus este exact e
. OJI 2018, clasele XII-XII
Problema | galeti | Operații I/O |
galeti.in /galeti.out
|
---|---|---|---|
Limita timp | 1 secunde | Limita memorie |
Total: 32 MB
/
Stivă 32 MB
|
Id soluție | #43502803 | Utilizator | |
Fișier | galeti.c | Dimensiune | 1.76 KB |
Data încărcării | 30 Aprilie 2023, 00:06 | Scor / rezultat | 0 puncte |
galeti.c: In function 'main': galeti.c:17:5: warning: format '%d' expects argument of type 'int *', but argument 3 has type 'long long int *' [-Wformat=] fscanf(fin, "%d%d", &n, &e); ^ galeti.c:17:5: warning: format '%d' expects argument of type 'int *', but argument 4 has type 'long long int *' [-Wformat=] galeti.c:25:13: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(fout, "%d %d\n", i, 1); ^ galeti.c:57:17: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(fout, "%d %d\n", j+1, j); ^ galeti.c:57:17: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=] galeti.c:64:21: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(fout, "%d %d\n", j+1, j); ^ galeti.c:64:21: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=] galeti.c:69:13: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(fout, "%d %d\n", n-1, n-2); ^ galeti.c:69:13: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=] galeti.c:70:13: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(fout, "%d %d\n", n, n-2); ^ galeti.c:70:13: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=] galeti.c:71:13: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=] fprintf(fout, "%d %d\n", n-2, 1); ^ galeti.c:17:11: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(fin, "%d%d", &n, &e); ^
Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
---|---|---|---|---|---|---|
0 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
1 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
2 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
3 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
4 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
5 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
6 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
7 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
8 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
9 | 0 secunde | Nu exista o astfel de galeata | 10 | 0 | ||
Punctaj total | 0 |
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema galeti 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ă.