← Back to topics
Topic

o-timberland

MilosRadic
can someone give me the third test case for this task...cant find any mistakes in the code but it still gives 10/26
Al3kSaNdaR
Hm I had some problems with input / output . I changed something and it works at my computer .

Here are the lines I changed :


char s[5];

scanf("%d %d",&n,&q);
scanf(" %s",&s);
scanf("%d %d",&a,&b);
scanf("%d %d",&a,&b);
scanf("%d",&a);
MilosRadic
hmm tried changing that but it seems thats not the problem.i have 10/26 so its not like i dont pass any tests...
MilosRadic
oduleodule just to remaind u about the 3.test case:D
boris4
try to remove "\n" from scanfs :D
matteo123
I have 25/26..can someone give me a hint to speed up my brute force
Al3kSaNdaR
Imas opis resenja ovde pa pogledaj : http://www.yuoi.nis.edu.rs/takmicenja/2011.0.kv1/5.o-timberlend/o-timberlend.solution.pdf
MilosRadic
ma pogledao sam resenje ali mene interesuje vise sto ovaj moj kod ne radi...
matteo123
meni nije jasno kako je moj jadan brute force dobio 96 bodova?
MilosRadic
na yuoi kaze brute force oko 60 poena:D
matteo123
eh...jbg to se onda zove sreća


btw. kada će medalje
MilosRadic
a daj za ovaj racun dali test primere a za ovaj najtezi nisu...
boris4
ok, mislim da sam ti nasao gresku...

kada je niz[i][i1] == 1, onda stavis sum = 0, medjutim tu treba da stavis i

for (it = asd.begin(); it != asd.end(); ++it) niz1[i1][(*it).first] = 0
MilosRadic
da video sam...resio sam...ne mogu da verujem sta nisam video:@...hvala u svakom slucaju:D
Dgleich
Postoji i bolje rjesenje, slozenosti N^2 po queryu :)
matteo123
jel možeš objasnit kako si ti radio na natjecanju??
MilosRadic
slozenosti O(n^2) po svakoj povrsini?kako to postizes??