#2220
Se consideră un șir a[1], a[2], …, a[n] de numere întregi. Să se determine diferența maximă de forma a[i] - a[j], unde 1 ≤ i < j ≤ n.
-
| Problema | DifMax | Operații I/O |
tastatură/ecran
|
|---|---|---|---|
| Limita timp | 0.15 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
| Id soluție | #64217362 | Utilizator | |
| Fișier | difmax.cpp | Dimensiune | 697 B |
| Data încărcării | 23 Aprilie 2026, 12:56 | Scor/rezultat | 0 puncte |
In file included from /usr/include/c++/13/string:51, from /usr/include/c++/13/bits/locale_classes.h:40, from /usr/include/c++/13/bits/ios_base.h:41, from /usr/include/c++/13/ios:44, from /usr/include/c++/13/istream:40, from /usr/include/c++/13/fstream:40, from difmax.cpp:1: In function ‘const _Tp& std::max(const _Tp&, const _Tp&) [with _Tp = int]’, inlined from ‘int main()’ at difmax.cpp:35:18: /usr/include/c++/13/bits/stl_algobase.h:262:7: warning: ‘ans’ may be used uninitialized [-Wmaybe-uninitialized] 262 | if (__a < __b) | ^~ difmax.cpp: In function ‘int main()’: difmax.cpp:31:9: note: ‘ans’ was declared here 31 | int ans; | ^~~
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 0 | 0.002 secunde | Raspuns gresit. | 10 | 0 | ||
| 1 | 0.003 secunde | Raspuns gresit. | 10 | 0 | ||
| 2 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 3 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 4 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 5 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 6 | 0.003 secunde | Raspuns gresit. | 10 | 0 | ||
| 7 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| 8 | 0.003 secunde | Raspuns gresit. | 10 | 0 | ||
| 9 | 0.001 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 0 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema DifMax 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ă.