any hints?:D
BOI-bins
hint 1: you can solve it in O(M*N)
hint 2: since M is small, you can count the number of occurrence of x so that you don't need to do sorting all the time
hint 2: since M is small, you can count the number of occurrence of x so that you don't need to do sorting all the time
yea i solved it and got in best times thanks so much for the hint:D
just a quest why cant my code pass in c(it gives 14/20) and in c++ it passes normally:S
i am new to c and c++
my 5th program in these languages:D
PS go resubmit operacije it is fixed now
just a quest why cant my code pass in c(it gives 14/20) and in c++ it passes normally:S
i am new to c and c++
my 5th program in these languages:D
PS go resubmit operacije it is fixed now
for task operacije, I just want to try your checker, test cases and other things, but I don't realize that it's published that's why I got so many WA's. I myself have not tried it..
your array niz is too small, since you start from 1 instead of 0 so you need at least niz[20001]. or something bigger than 20000. try it dunno if that's the case :)
so in c arrays start from 1?
can i make an array start at any number less than 0
like in pascal u can have array -3..5 or smt
can i make an array start at any number less than 0
like in pascal u can have array -3..5 or smt
In C, an array that is declared to have the length of N will have elements in the range of 0..N--1. You cannot make it start from, for example, -2, but you could just calculate the indexes like it started from -2 and than add 2 to them.
Hope I helped.
Hope I helped.
ok:D thanks!
You can do this
Now you can use all values from pok[-5000] to pok[4999]
int niz[10000];
int *pok=niz+5000;
Now you can use all values from pok[-5000] to pok[4999]
So simple and elegant
you can try this:
Edit: beaten xD
int niz[10000];
#define niz (niz + 5000)Edit: beaten xD