DYNAMO : Jan 2020 video editorial

Hey folks , here you can find the video editorial of

DYNAMO

Thank you guys for watching and keep coding.
CodeNCdode

1 Like

Your efforts are really helpful brother.

Thank you man :smile:

Can’t you just compile all of these things into 1 thread instead of spreading it out everywhere?

2 Likes

what is wrong in my solution?
#include
#include<math.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t–)
{
int n,p=2,r;
cin>>n;
long long int a,sum,w,x,y,z,b;
cin>>a;
x=2*pow(10,n);
sum=a-2+x;
cout<<sum<<endl;
fflush(stdout);
while(p–)
{
cin>>b;
y=pow(10,n);
z=y-1;
w=z-b;
cout<<w<<endl;
fflush(stdout);
}
cin>>r;
if(r==-1) break;
}
}

ur code will fail one of these cases
n=2
99
99
99

or n=2
1
1
1

2 Likes

Now , i got my mistake . Thanks for helping.

Wait, I’ll do it Now

1 Like

where is the solution link?

Looks like you forget

Here is my code in Python.
When I ran it in my IDE it was working but not here on codechef. Can you tell me where is the problem? Please.
` # cook your dish here
import random
try:
for _ in range(int(input())):
n = int(input())
A = int(input())

        S = (3 * 10**n) + random.randint(1, 10**n)
        print(S)
        stdout.flush()
        
        B = int(input())
        C = random.randint(1, 10**n)
        print(C)
        stdout.flush()
        
        D = int(input())
        
        E = S - (A + B + C + D)
        print(E)
        stdout.flush()
        if int(input()) == -1:
            break
        
except EOFError:
    pass`