@pratyush1019: Stealing another INOI seat from a worthy candidate, your girlfriend also must have scored 200 then… right?
It was just my computer, that was slow. It ran within 1 sec on codechef’s server. The test case was randomised, taking care that no number repeats.
Btw, do you know how fast the server that IARCS will use for testing is?
@srijon Lucky you. I had to change computers 4 times. Finally the 5th one I got was good enough, but really bad keyboard plus really slow, but whatever, I had only 100 minutes or so after all the changing. So I used them to the best I could, and am expecting 130 now. I coded the one for 2nd subtask of problem 1, but was getting WA, and had only 5 minutes or so left, so decided to let it go and leave. The centre etc. was really really poor.
Yes, as far as I remember K was <= N for 2nd subtask
Can anybody tell what was the book shelf problem about ? If you remember the statement…
Here is my code for video game challenge…three of the tests work fine but getting wa for rest…I really cant figure out why I am getting WA?
#include
#include
using namespace std;
int main()
{
long long N;
long long H;
cin>>N;
cin>>H;
long long n=1;
long long b=0;
long long a[N];
for(long long i=1;i<=N;i++)
{
cin>>a[i];
}
long long com[100000];
long long m=0;
while(1) {
cin>>com[m];
if(com[m]!=0)
{
m++;
}
else if(com[m]==0)
break;
}
for(long long t=0;t<m;t++)
{
switch(com[t])
{
case 1:
{
if(n> 1)
n--;
else
{}
break;
}
case 2:
{
if(n< N)
n++;
else{}
break;
}
case 3:
{
if(b==1)
{
}
else if(b==0)
{
if(a[n]>0)
{
a[n]=a[n]-1;
b=1;
}
else{}
}
break;
}
case 4:
{
if(b==0)
{
}
else if(b==1)
{
if(a[n]<H)
{ a[n]=a[n]+1;
b=0;}
else
{
}
}
break;
}
}
}
for(long long i=1;i<=N;i++)
{
cout<<a[i];
}
}
Hello guyz…
I wrote a code for Bookshelves and it worked for all cases i could think of.
However, when I posted in ZCO practise contest, some of the test cases arent working.
Can someone check the code and tell me the mistake?