foo.cpp: In function 'void work()':
foo.cpp:47:21: error: lvalue required as left operand of assignment
if(up==1000000&&ans=1000000)cout<<"INF"<<endl;
^
foo.cpp: In function 'void record(int, int)':
foo.cpp:62:32: warning: unused variable 'b1' [-Wunused-variable]
int num1=num[n1],num2=num[n2],b1=b[n1],b2=b[n2],b3=max(b[n1],b[n2]),i;
^
foo.cpp:62:41: warning: unused variable 'b2' [-Wunused-variable]
int num1=num[n1],num2=num[n2],b1=b[n1],b2=b[n2],b3=max(b[n1],b[n2]),i;
^
foo.cpp:62:70: warning: unused variable 'i' [-Wunused-variable]
int num1=num[n1],num2=num[n2],b1=b[n1],b2=b[n2],b3=max(b[n1],b[n2]),i;
^