HDU 4762 Cut the Cake (高精度 + 公式)
来源:互联网 发布:信阳淘宝摄影e 编辑:程序博客网 时间:2024/06/05 09:35
可得公式: n / (m^(n-1))
import java.io.*;import java.math.*;import java.util.*;public class Main {public static void main(String[] args) {Scanner sc = new Scanner(System.in);int t = sc.nextInt();for (int i = 0; i < t; ++i) {int m = sc.nextInt();int n = sc.nextInt();BigInteger s = BigInteger.valueOf(n);BigInteger a = BigInteger.valueOf(m).pow(n - 1);BigInteger g = a.gcd(s);//System.out.println(g);System.out.println(s.divide(g) + "/" + a.divide(g));}}}
0 0
- HDU 4762 Cut the Cake (高精度 + 公式)
- hdu 4762 Cut the Cake(高精度)
- hdu 4762 Cut the Cake(高精度&概率)
- hdu 4762 Cut the Cake(推导+高精度)
- HDU 4762-Cut the Cake(概率+高精度)
- HDOJ 4762 - Cut the Cake 推公式.高精度
- HDU 4762 Cut the Cake(概率+推理+高精度)
- HDu 4762 Cut the Cake 概率(推公式,积分)
- HDU 4762 Cut the Cake
- HDU-4762 Cut the Cake
- hdu 4762 Cut the Cake (概率 + java大数)
- hdu 4762 - Cut the Cake(大数)
- [HDU 4328] Cut the cake (悬链法)
- HDU 4328 - Cut the cake
- hdu 4328 Cut the cake
- hdu 4328 Cut the cake
- hdu 4328 Cut the cake
- HDU-4328-Cut the cake
- 日常知识积累
- hdu1166敌兵布阵(线段树模板)
- 饿了么面试
- Linux命令之write调用的原子性
- 监听套接字 连接套接字
- HDU 4762 Cut the Cake (高精度 + 公式)
- cocos2dx中的坐标系和锚点
- 浅谈java单例模式——优点以及为什么使用到synchronized
- error C2872: “Font”: 不明确的符号
- extjs关于treePanel+chekBox全部选中以及清空选中问题探讨
- java 排序算法---插入排序
- The Factor(hdu5428)
- Android的AsyncTask和数据存储
- 重新认识二级指针(Pointers to Pointers)