Skiry Posted February 4, 2014 Report Posted February 4, 2014 Buna ziua. Ma chinui de vreo ora sa rezolv o problema(pe campion)..De fapt,am rezolvat-o , dar la 16/20 de verificari imi da : "Killed By Signal" ..si la restul,"OK",deci am rezolvat corect..si nu inteleg cum pot rezolva cu problema asta cu " Killed By Signal",am inteles mai demult ca e de la marimea vectorului,am marit-o,dar degeaba..putin ajutor ?Multumesc. Quote
Active Members MrGrj Posted February 4, 2014 Active Members Report Posted February 4, 2014 Si problema ? Quote
Raz0R99 Posted February 4, 2014 Report Posted February 4, 2014 Zi exact ce problem? ai, ai declarat corect vectorul? Quote
Skiry Posted February 4, 2014 Author Report Posted February 4, 2014 (edited) Da. Acolo spune 1<= n <= 20000Am declarat vectorul a[20005] si imi da ca am trecut limita de timp,iar daca il micsorez cam pe la a[10000] imi da Killed By Signal Edited February 4, 2014 by Skiry Quote
totti93 Posted February 4, 2014 Report Posted February 4, 2014 Banuiesc ca se fac teste cu valori diferite. Cele cu "Time limit exceeded!" probabil sugereaza faptul ca algoritmul tau e lent, iar la cele cu "Killed by signal: 11" probabil accesezi o zona de memorie ce nu ai voie. Un fel de "Segmentation fault". Atata timp cat nu postezi codul sursa, nu prea te putem ajuta.L.E.: Posteaza si cerinta. Quote
Active Members MrGrj Posted February 5, 2014 Active Members Report Posted February 5, 2014 Incearca asta:std::vector<structureType> vectorName; // retine in momentul de fata 0 elemeentevectorName.reserve(100); // retine tot 0 elemente dar are capacitatea de 100 Modifici tu 100 cu cat iti tre'. Quote