贴个模板:平常的跟高精度java的;
int:
#pragma comment(linker, "/STACK:1024000000,1024000000")#include#include #include #include #include #include #include #include #include #include #include
#include
java:
import java.util.*;import java.math.*;public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); BigInteger k=new BigInteger("16180339887498948482045868343656381177203091798057628621354486227052604628189024497072072041893911374"); BigInteger p=new BigInteger("10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"); int T; T=cin.nextInt(); while(T--!=0) { BigInteger nn=cin.nextBigInteger(); BigInteger mm=cin.nextBigInteger(); BigInteger n=nn.min(mm); BigInteger m=nn.max(mm); BigInteger j=m.subtract(n); j=j.multiply(k); j=j.divide(p); if(j.equals(n)) System.out.println("B"); else System.out.println("A"); } }}