### abhimanyu_sahrawat's blog

By abhimanyu_sahrawat, history, 2 months ago,

import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { double x1=sc.nextDouble(); double p1= sc.nextDouble(); double x2= sc.nextDouble(); double p2=sc.nextDouble(); double mulx1=0; double mulx2=0;

if (x1==0){
x1=1;
} else {
x1=x1;
}
if (x2==0){
x2=1;
}else {
x2=x2;
}
if (p1>0){
mulx1=x1*Math.pow(10,p1);
}else {
mulx1=x1*1;

}

if (p2>0){
mulx2=x2*Math.pow(10,p2);
}else {
mulx2=x2*1;
}
if (mulx1>mulx2)
System.out.println(">");
else if (mulx1<mulx2)
System.out.println("<");
else if (mulx1== mulx2)
System.out.println("=");

}

}

}

• -17

 » 2 months ago, # |   -9 Your code is completely unreadable, do this: Result#include #define mp make_pair #define mt make_tuple using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; const ll INFL = (1LL<<62)-1; const int INF = (1<<30)-1; const int MAXN = 0; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int in; while(cin >> in){ cout << bitset<6>(in) << '\n'; } return 0; } 
•  » » 2 months ago, # ^ |   0 thanks bro but im not getting it how to do this sorry for disturbing u
•  » » » 7 weeks ago, # ^ |   0 If you put 3 backticks (`) at the start and at the end of your code codeforces will actually break the lines and make everything pretty
•  » » » » 7 weeks ago, # ^ |   0 ohh ty man
 » 2 months ago, # |   0 First off,dont read doubles if the problem specifies ints. Also there's no point checking if x1/x2 are equal to 0, the problem states they're always more or equal to one. The corresponding else clauses are completely useless, just throw both of them out. I see you tried to exponentiate and do a simple comparison, but that wont do. p1 and p2 can be as big as 10^6, so there's gonna be an overflow in mulx1/mulx2.In my solution, I first compared the number of digits in each number, and print out a solution immediately, or if they're the same multiply the smaller number by 10 until both x1 and x2 have the same number of digits and do a comparison then.