← Back to topics
Topic

o-timberland

M
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
A
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);
M
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...
M
MilosRadic
oduleodule just to remaind u about the 3.test case:D
b
boris4
try to remove "\n" from scanfs :D
m
matteo123
I have 25/26..can someone give me a hint to speed up my brute force
A
Al3kSaNdaR
Imas opis resenja ovde pa pogledaj : http://www.yuoi.nis.edu.rs/takmicenja/2011.0.kv1/5.o-timberlend/o-timberlend.solution.pdf
M
MilosRadic
ma pogledao sam resenje ali mene interesuje vise sto ovaj moj kod ne radi...
m
matteo123
meni nije jasno kako je moj jadan brute force dobio 96 bodova?
M
MilosRadic
na yuoi kaze brute force oko 60 poena:D
m
matteo123
eh...jbg to se onda zove sreća


btw. kada će medalje
M
MilosRadic
a daj za ovaj racun dali test primere a za ovaj najtezi nisu...
b
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
M
MilosRadic
da video sam...resio sam...ne mogu da verujem sta nisam video:@...hvala u svakom slucaju:D
D
Dgleich
Postoji i bolje rjesenje, slozenosti N^2 po queryu :)
m
matteo123
jel možeš objasnit kako si ti radio na natjecanju??
M
MilosRadic
slozenosti O(n^2) po svakoj povrsini?kako to postizes??