Hey folks , here you can find the video editorial of
Thank you guys for watching and keep coding.
CodeNCdode
Hey folks , here you can find the video editorial of
Thank you guys for watching and keep coding.
CodeNCdode
Your efforts are really helpful brother.
Thank you man
Can’t you just compile all of these things into 1 thread instead of spreading it out everywhere?
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
Now , i got my mistake . Thanks for helping.
Wait, I’ll do it Now
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`
it has to be something with compiler , your approach looks fine to me , but i can’t say anything about the implementation since i do not work with python i am a simple C++ man.