SGU 112.a^b - b^a
题意:
如标题。
方法:
简单高精度。。。
代码(继续JAVA 水过)
import java.util.*;
import java.math.*;
public class Solution {
public static void main(String[] args){
Scanner cin=new Scanner(System.in);
int a=cin.nextInt(),b=cin.nextInt();
BigInteger s,t;
s=BigInteger.valueOf(a).pow(b);
t=BigInteger.valueOf(b).pow(a);
System.out.print(s.subtract(t));
}
}
SGU 112.a^b - b^a的更多相关文章
- 快速切题 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 num ...
- a^b-b^a - SGU 112(高精度快速幂)
分析:直接上吧,建议不要使用模板,否则没啥意义了. 代码如下: ==================================================================== ...
- 高精度 - SGU 112 a^b-b^a
a^b-b^a Problem's Link Mean: 略 analyse: 简单题,只用编个高精度乘法和减法即可. Time complexity: O(N) view code java im ...
- SGU题目总结
SGU还是个不错的题库...但是貌似水题也挺多的..有些题想出解法但是不想写代码, 就写在这里吧...不排除是我想简单想错了, 假如哪位神犇哪天发现请告诉我.. 101.Domino(2015.12. ...
- SGU 分类
http://acm.sgu.ru/problemset.php?contest=0&volume=1 101 Domino 欧拉路 102 Coprime 枚举/数学方法 103 Traff ...
- Entity Framework 6 Recipes 2nd Edition(11-2)译 -> 用”模型定义”函数过滤实体集
11-2. 用”模型定义”函数过滤实体集 问题 想要创建一个”模型定义”函数来过滤一个实体集 解决方案 假设我们已有一个客户(Customer)和票据Invoice)模型,如Figure 11-2所示 ...
- backup log is terminating abnormally because for write on file failed: 112(error not found)
昨天遇到一个案例,YourSQLDba做事务日志备份时失败,检查YourSQLDba输出的错误信息如下: <Exec> <ctx>yMaint.backups</ctx& ...
- DBCC CHECKDB 遭遇Operating system error 112(failed to retrieve text for this error. Reason: 15105) encountered
我们一个SQL Server服务器在执行YourSQLDBa的作业YourSQLDba_FullBackups_And_Maintenance时遇到了错误: Exec YourSQLDba.Maint ...
- Write on ……… failed: 112(failed to retrieve text for this error. Reason: 15105)
早上检查数据库的备份邮件时,发现一台Microsoft SQL Server 2008 R2 (SP2)数据库的Maintenance Report有错误 在SSMS里面执行Exec YourSQLD ...
随机推荐
- Node.js权威指南 (8) - 创建HTTP与HTTPS服务器及客户端
8.1 HTTP服务器 / 177 8.1.1 创建HTTP服务器 / 177 8.1.2 获取客户端请求信息 / 182 8.1.3 转换URL字符串与查询字符串 / 184 8.1.4 发送服务器 ...
- Welcome Back to C++ (Modern C++)
http://msdn.microsoft.com/en-us/library/hh279654.aspx 看看你是古代还是现代Cpper重点强调 Stack-based scope instead ...
- soundtouch源码分析__based on csdn :
1. soundtouch介绍和相关资源 The SoundTouch Library Copyright © Olli Parviainen 2001-2014 SoundTouch is an o ...
- Hibernate(四)基本映射
映射的概念 在上次的博文Hibernate(三)Hibernate 配置文件我们已经讲解了一下 Hibernate中的两种配置文件,其中提到了两种配置文件的主要区别就是XML可以配置映射.这里提到的映 ...
- HDOJ/HDU 2568 前进(简单题)
Problem Description 轻松通过墓碑,进入古墓后,才发现里面别有洞天. 突然,Yifenfei发现自己周围是黑压压的一群蝙蝠,个个扇动翅膀正准备一起向他发起进攻! 形势十分危急! 好在 ...
- c语言 快速排序---归并排序----堆排序
//快速排序: #include <stdio.h> #define MAX 500000 int s[MAX]; void Q_Sort(int start,int end) { int ...
- poj 3159 Candies
Candies Time Limit: 1500MS Memory Limit: 131072K Total Submissions: 25776 Accepted: 7033 Descrip ...
- Oracle RAC中的投票算法
RAC集群中有三台机器,A,B,C A,B,C都会有3票,假设这是A的心跳线出现问题,整个RAC集群就划分为两个paritition, 一个是只有A的partition,一个是B,C组成的partit ...
- 用函数生成select选择框
// 生成 html select option 标签 function build_options($options, $opt='',$k='') { $frags = array(); if ( ...
- Windows 10 Technical Preview 10041 使用 IIS Express 运行网站应用程序异常
在 Windows 10 中使用 Visual Studio 2013 Ultimate with Update 4 开发网站,9926 的时候还好好的,升到 10041 就不能调试了: “Syste ...