#2087
Kminsum
Se consideră un număr natural k
și două tablouri unidimensionale A
și B
, cu n
respectiv m
elemente, numere întregi, sortate crescător. Să se afișeze primele k
perechi de numere de sumă minimă. Fiecare pereche conține un număr din A
, un număr din B
.
Problema | Kminsum | Operații I/O |
kminsum.in /kminsum.out
|
---|---|---|---|
Limita timp | 0.02 secunde | Limita memorie |
Total: 64 MB
/
Stivă 8 MB
|
Id soluție | #18045627 | Utilizator | |
Fișier | kminsum.cpp | Dimensiune | 548 B |
Data încărcării | 27 Octombrie 2019, 17:14 | Scor / rezultat | Eroare de compilare |
kminsum.cpp:7:7: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] main () ^ kminsum.cpp: In function 'int main()': kminsum.cpp:11:13: warning: suggest parentheses around assignment used as truth value [-Wparentheses] for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:21: warning: for increment expression has no effect [-Wunused-value] for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:24: error: expected ')' before ';' token for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:26: warning: statement has no effect [-Wunused-value] for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:35: error: expected ';' before '++' token for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:31: warning: statement has no effect [-Wunused-value] for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:43: error: expected primary-expression before ')' token for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^ kminsum.cpp:11:43: error: expected ';' before ')' token kminsum.cpp:29:5: error: expected ';' before '}' token } ^ kminsum.cpp:11:20: error: label 'i' used but not defined for(i=1;j=1; && i<=n;j<=m; && i++;j++; ) ^
www.pbinfo.ro permite evaluarea a două tipuri de probleme:
Problema Kminsum 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ă.