Question about output

Question about output

Is it really necessary that output of our program is exact match to given output.txt file? In our case because second test case is shorter that task is executed faster than the first one so we get that second test case is written first on the console window.

7 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hi!It is necessary! They said: "Result has to be exactly the same as this reference code for any set of input-output-parameters.".You should sort output before printing it.

The result is the same, but order is not. It's like this:test_sequence_21342 1392 1700 1750test_sequence_11 910 771 1680911 1680 1 7701681 2088 1681 2088it's because one core is computing one sequence and the second core the second

I get the same result when i put-tbb::task_scheduler_init init(1); , but when i put 2,3,4 instead of 1, i get totally messed up result lines.Does anybody know how to solve this ? Problem is caused by parallel_do and i dont know how to explicitly organize my threads :/

HelloI don't know il you always have the problem, but you can for example store your results in a map and sort it after the computs (after all the threads stops)

hello!yes,thereare quite away tomanagethis problem,like usingthe# pragmaompbarrierandthen viewthe result,threadbythread,or,to put away allthesequensein a structureand thentodisplay theresult with one thread

for your information,you needto displaythe sequencename,even if itis empty

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!