You are viewing a single comment's thread. Return to all comments →
java
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for (int i = 0; i < n; i++) { long result = Long.MAX_VALUE; long a = sc.nextLong(); long b = sc.nextLong(); for (long j = a; j <= b; j++) { result = result & j; } System.out.println(result); } } }
Seems like cookies are disabled on this browser, please enable them to open this website
AND Product
You are viewing a single comment's thread. Return to all comments →
java