哇咔咔 卡函数的
标记一下 c++和java的进制转换函数都是1-36进制的
c++ long long暴力就过了。。。
自己写一个就好了
import java.math.BigInteger; import java.util.*; import java.util.Arrays.*; public class Main { static final int maxn = 1002; public static void main(String[] args) { Scanner cin = new Scanner(System.in); String str1 = new String(); int n = cin.nextInt(); int m = cin.nextInt(); BigInteger a = BigInteger.ONE; for(int i=n-1; i>=0; i--) { str1 = cin.next(); a = a.add(change(str1, m, i)); } n = cin.nextInt(); m = cin.nextInt(); BigInteger b = BigInteger.ONE; for(int i=n-1; i>=0; i--) { str1 = cin.next(); b = b.add(change(str1, m, i)); } if(a.compareTo(b) == 0) System.out.println("="); else if(a.compareTo(b) < 0) System.out.println("<"); else System.out.println(">"); } public static BigInteger change(String str, int m, int i){ BigInteger c = new BigInteger(str); c = c.multiply(new BigInteger(""+m).pow(i)); return c; } }