Jump to content
Skiry

O Problema..

Recommended Posts

Posted

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.

Posted (edited)

Da. Acolo spune 1<= n <= 20000

Am 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 :-??

prob.jpg

Edited by Skiry
Posted

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.

  • Active Members
Posted

Incearca asta:


std::vector<structureType> vectorName; // retine in momentul de fata 0 elemeente
vectorName.reserve(100); // retine tot 0 elemente dar are capacitatea de 100

Modifici tu 100 cu cat iti tre'.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...