2016SDAU课程练习一1012 Problem M

本文介绍了一个关于高效计算整数根的编程问题,包括输入输出要求、示例及AC代码。此外,还提供了float、double和long double等数据类型的位长、有效数字与绝对值范围。
Problem M
Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 60000/30000K (Java/Other)
Total Submission(s) : 50   Accepted Submission(s) : 27
Problem Description
Current work in cryptography involves (among other things) large prime numbers and computing powers of numbers among these primes. Work in this area has resulted in the practical use of results from number theory and other branches of mathematics once considered to be only of theoretical interest.
This problem involves the efficient computation of integer roots of numbers.
Given an integer n>=1 and an integer p>= 1 you have to write a program that determines the n th positive root of p. In this problem, given such integers n and p, p will always be of the form k to the nth. power, for an integer k (this integer is what your program must find).
 

Input
The input consists of a sequence of integer pairs n and p with each integer on a line by itself. For all such pairs 1<=n<= 200, 1<=p<10<sup>101</sup> and there exists an integer k, 1<=k<=10<sup>9</sup> such that k<sup>n</sup> = p.
 

Output
For each integer pair n and p the value k should be printed, i.e., the number k such that k n =p.
 

Sample Input
2 16 3 27 7 4357186184021382204544
 

Sample Output
4 3 1234
没啥好说的了,本来还想用模拟,想想不会干脆用常规方法做了,结果ac了。。。
还有无限循环。。。
到网上找了一下几个数据类型的范围分享一下:
类型            长度 (bit)           有效数字                   绝对值范围

    float            32                     6~7                 10^(-37) ~ 10^38

    double         64                    15~16              10^(-307) ~10^308

    long double  128                  18~19               10^(-4931) ~ 10 ^ 4932

ac代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<set>
#include<algorithm>
using namespace std;
int main(){
 int n;
 double p;
 while(cin>>n){
  cin>>p;
  cout<<pow(p,1.0/n)<<endl;
 }
 return 0;
}
下载前必看:https://pan.quark.cn/s/a16f11f200be 在建筑工程的范畴内,沟槽开挖是项至关重要的基础施工技术,其在市政工程、管道铺设以及地基加固等多个领域得到了普遍应用。 本文将聚焦于“沟槽开挖交底”这核心议题,致力于呈现系统且深入的沟槽开挖知识体系,从而协助相关人员掌握其关键流程、安全规范以及技术精髓。 沟槽开挖的过程中通常包含以下几个核心要素:1. **设计与规划**:在沟槽开挖启动之前,必须依据设计图纸进行周密的施工方案制定,明确沟槽的宽度、深度、长度及形态。 设计工作需综合考量土壤性质、地下水位、周边建筑物的状况等因素,以保障结构稳定性和施工安全性。 2. **土方计算**:依据沟槽的具体尺寸,精确计算需要移除的土方量,以便于科学安排运输和回填作业。 这环节涉及体积计算方法和土方平衡原理,旨在实现工程成本的合理化控制。 3. **施工方法**:常用的开挖方式包括直壁开挖、放坡开挖、支撑开挖等。 选择何种方法应综合考虑地质条件、工程规模、工期要求以及成本预算等因素。 例如,在软土区域可能需要实施降水和支护措施。 4. **安全措施**:在沟槽开挖的整个过程中,必须严格遵守安全操作规程,包括设置警示标识、安装安全护栏、预防土体滑坡等。 同时,需定期检测边坡的稳定性,迅速应对潜在风险。 5. **地下水控制**:当地下水位较高时,可能需要采取降水措施,例如采用井点降水或轻型井点降水技术,以避免沟槽内部积水,确保作业环境的安全。 6. **环境保护**:在开挖作业中,应注重减轻对周边环境的影响,例如控制施工噪声、减少尘土飘散以及防止水土流失。 此外,应妥善处置挖掘出的土方,防止造成二次污染。 7. **机械设备选择**:根据沟槽的尺寸和地质状况,挑选适...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值