SGU_112
用Java的BigInteger很容易实现。
import java.math.BigInteger;
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int a, b;
while(cin.hasNext())
{
a = cin.nextInt();
b = cin.nextInt();
System.out.println(BigInteger.valueOf(a).pow(b).add(BigInteger.valueOf(b).pow(a).negate()));
}
}
}