快速切题 sgu 112. a^b-b^a 大数 次方 难度:0 非java:1
112. a^b-b^a
time limit per test: 0.25 sec.
memory limit per test: 4096 KB
You are given natural numbers a and b. Find a^b-b^a.
Input
Input contains numbers a and b (1≤a,b≤100).
Output
Write answer to output.
Sample Input
2 3
Sample Output
-1
import java.io.*;
import java.math.BigInteger;
import java.util.Scanner; public class Main {
public static void main(String []args) throws IOException{
int a,b;
Scanner scanner=new Scanner(System.in);
a=scanner.nextInt();b=scanner.nextInt();
BigInteger A=BigInteger.valueOf(a);
BigInteger B=BigInteger.valueOf(b);
A=A.pow(b);B=B.pow(a);
A=A.subtract(B);
System.out.println(A);
}
}
快速切题 sgu 112. a^b-b^a 大数 次方 难度:0 非java:1的更多相关文章
- 快速切题 sgu 111.Very simple problem 大数 开平方 难度:0 非java:1
111.Very simple problem time limit per test: 0.5 sec. memory limit per test: 4096 KB You are given n ...
- 快速切题 poj 2993 Emag eht htiw Em Pleh 模拟 难度:0
Emag eht htiw Em Pleh Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 2806 Accepted: ...
- 快速切题 poj 3026 Borg Maze 最小生成树+bfs prim算法 难度:0
Borg Maze Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8905 Accepted: 2969 Descrip ...
- SGU 139. Help Needed! 逆序数,奇偶性,分析 难度:0
139. Help Needed! time limit per test: 0.25 sec. memory limit per test: 4096 KB Little Johnny likes ...
- windows下9款一键快速搭建PHP本地运行环境的好工具(含php7.0环境)
推荐几款一键快速搭建PHP本地运行环境的好工具(含php7.0及apache,nigix,mysql) 首推phpstudy2016和wampServer3.0.6 理由支持php7.0 目前 ...
- a^b-b^a - SGU 112(高精度快速幂)
分析:直接上吧,建议不要使用模板,否则没啥意义了. 代码如下: ==================================================================== ...
- SGU 112.a^b - b^a
题意: 如标题. 方法: 简单高精度... 代码(继续JAVA 水过) import java.util.*; import java.math.*; public class Solution { ...
- 快速切题sgu127. Telephone directory
127. Telephone directory time limit per test: 0.25 sec. memory limit per test: 4096 KB CIA has decid ...
- 快速切题sgu126. Boxes
126. Boxes time limit per test: 0.25 sec. memory limit per test: 4096 KB There are two boxes. There ...
随机推荐
- 优化css,增加性能
转载自:https://www.cnblogs.com/xiaoloulan/p/5801663.html 前端性能优化一直是一个比较热门的话题,我们总是在尽我们最大的努力去,提高我们的页面性能,比如 ...
- Spark集群 Python Package管理
具体问题: 不同的数据分析人员/开发团队需要不同版本的Python版本执行PySpark. 同一Python版本下,需要安装多个Python库,甚至需要不同版本的库. 针对问题2的一个解决办法是将Py ...
- CSS3、SVG、Canvas、WebGL动画精选整理
一.CSS3动画 名称 用途 链接 阴影波纹特效 1.元素hover效果 2.突出表现效果 http://www.jq22.com/code80 横板导航菜单动画 导航菜单 http://www.jq ...
- springCloud3---ribbon
同一份代码,改变端口,就可以启动多个同名但是端口不一样的微服务. 客户端通过nginx来调用后面的多个用户微服务来实现负载均衡,这是服务端负载均衡. 客户端有一个组件,可以知道当前有几个用户微服务的i ...
- docker issue-Cannot connect to the Docker daemon. Is 'docker -d' running on this host?
Here is my docker version when i run docker version : Client: Version: 1.8.1 API version: 1.20 Go ve ...
- JMeter插件管理器
JMeter插件管理器 来自官网:https://jmeter-plugins.org/wiki/PluginsManager/ JMeter插件管理器的想法很简单:不是手动安装各种插件,而是通过漂亮 ...
- MongoDB使用中的一些问题
1.count统计结果错误 这是由于分布式集群正在迁移数据,它导致count结果值错误,需要使用aggregate pipeline来得到正确统计结果,例如: db.collection.aggreg ...
- Pentester中的XSS详解
本次做的是Web For Pentester靶机里面的XSS题目,一共有9道题目. 关于靶机搭建参考这篇文章:渗透测试靶机的搭建 第1题(无过滤措施) 首先在后面输入xss: http://10.21 ...
- 优秀 H5 案例收集 vol.4(不定期更新)
重返木叶村 http://hyrz.qq.com/act/a20160113muyecun/index.html 飞越淘宝奇市 https://g.alicdn.com/fdilab/flyover- ...
- jqGrid('setSelection',rowid)报Cannot read property 'multiple' of undefined
项目组非要上jeeweb框架,用jqgrid+大量iframe做为前端框架,臃肿不堪. 今天上午,在进行选定操作jqGrid('setSelection',rowid)报Cannot read pro ...