#4115
După o lungă activitate în domeniul instalaţiilor sanitare, Dorel s-a hotărât să investească averea acumulată în acţiuni ale mai multor companii. Astfel, el dispune de o listă cu N companii la care vrea să cumpere acţiuni, în M zile consecutive. Fiind date Q seturi de valori zi, zf, cl, cr, el doreşte să afle ce sumă a investit în perioada cuprinsă între zilele zi și zf (inclusiv acestea), la companiile cu numere de ordine cuprinse între cl și cr (inclusiv acestea).
| Problema | investitie | Operații I/O |
investitie.in/investitie.out
|
|---|---|---|---|
| Limita timp | 0.6 secunde | Limita memorie |
Total: 512 MB
/
Stivă 64 MB
|
| Id soluție | #38492451 | Utilizator | |
| Fișier | investitie.cpp | Dimensiune | 2.00 KB |
| Data încărcării | 11 Octombrie 2022, 18:48 | Scor/rezultat | 50 puncte |
investitie.cpp: In function 'int main()': investitie.cpp:12:24: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=] scanf("%d%d", &n,&m); ^ investitie.cpp:12:24: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=] investitie.cpp:16:26: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=] scanf("%d", &v[i]); ^ investitie.cpp:44:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int j=0;j<siruri[i].size();j++) ^ investitie.cpp:52:18: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=] scanf("%d",&q); ^ investitie.cpp:56:45: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=] scanf("%d%d%d%d", &x1, &x2, &y1, &y2); ^ investitie.cpp:56:45: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=] investitie.cpp:56:45: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long long int*' [-Wformat=] investitie.cpp:56:45: warning: format '%d' expects argument of type 'int*', but argument 5 has type 'long long int*' [-Wformat=] investitie.cpp:79:27: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=] printf("%d\n", rez); ^ investitie.cpp:10:39: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("investitie.in","r",stdin); ^ investitie.cpp:11:43: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result] freopen("investitie.out", "w", stdout); ^ investitie.cpp:12:25: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d", &n,&m); ^ investitie.cpp:16:27: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &v[i]); ^ investitie.cpp:52:19: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d",&q); ^ investitie.cpp:56:46: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result] scanf("%d%d%d%d", &x1, &x2, &y1, &y2); ^
| Test | Timp | Mesaj evaluare | Scor posibil | Scor obținut | ||
|---|---|---|---|---|---|---|
| 1 | 0.004 secunde | OK. | 2 | 2 | ||
| 2 | 0.072 secunde | OK. | 2 | 2 | ||
| 3 | 0.208 secunde | OK. | 2 | 2 | ||
| 4 | 0.288 secunde | OK. | 2 | 2 | ||
| 5 | 0.444 secunde | OK. | 2 | 2 | ||
| 6 | 0 secunde | OK. | 3 | 3 | ||
| 7 | 0 secunde | OK. | 3 | 3 | ||
| 8 | 0 secunde | OK. | 3 | 3 | ||
| 9 | 0 secunde | OK. | 3 | 3 | ||
| 10 | 0.004 secunde | OK. | 4 | 4 | ||
| 11 | 0.004 secunde | OK. | 4 | 4 | ||
| 12 | 0.108 secunde | OK. | 4 | 4 | ||
| 13 | 0.444 secunde | Raspuns gresit. | 8 | 0 | ||
| 14 | 0.444 secunde | OK. | 2 | 2 | ||
| 15 | 0.16 secunde | OK. | 2 | 2 | ||
| 16 | 0.2 secunde | OK. | 2 | 2 | ||
| 17 | 0.348 secunde | OK. | 2 | 2 | ||
| 18 | 0.012 secunde | OK. | 4 | 4 | ||
| 19 | 0.064 secunde | OK. | 4 | 4 | ||
| 20 | 0.124 secunde | Raspuns gresit. | 4 | 0 | ||
| 21 | 0.18 secunde | Raspuns gresit. | 4 | 0 | ||
| 22 | 0.236 secunde | Raspuns gresit. | 4 | 0 | ||
| 23 | 0.236 secunde | Raspuns gresit. | 4 | 0 | ||
| 24 | 0.104 secunde | Raspuns gresit. | 6 | 0 | ||
| 25 | 0.212 secunde | Raspuns gresit. | 10 | 0 | ||
| 26 | 0.372 secunde | Raspuns gresit. | 10 | 0 | ||
| Punctaj total | 50 | |||||
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema investitie 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ă.