A
来源:互联网 发布:淘宝上的运费险怎么退 编辑:程序博客网 时间:2024/06/07 09:46
You are given a positive integer n, please count how many positive integers k satisfy kk≤n .
Each case only contains a positivse integer n in a line.
14
12
#include<stdio.h>#include<iostream>#include<algorithm>using namespace std;long long int mutu(long long int x,long long int k){long long int ans = 1;long long int temp = x;while (k){if (k & 1){ans = ans*temp;}temp *= temp;k >>= 1;}return ans;}int main(){long long int n;while (cin >> n){for (int i = 15; i >= 0; i--){if (mutu(i, i) <= n){cout << i << endl;break;}}}return 0;}
阅读全文
0 0
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- a
- A
- A*
- a
- A
- a
- Android WindowManager及其动画问题
- 拾记-开发语言-bit/byte的关系
- Redis List命令
- 为了看百年一遇的日全食,美帝人们都干了什么
- 排队买手机不如买股票!苹果即将成为第一家市值1万亿美元的公司!
- A
- 09-28 略感
- 资源地址
- 通过adb采集app性能的native heap、dalvik heap、psstotal大小
- EasyDarwin在Linux下的安装说明
- QDir::toNativeSeparators的使用
- 8-31 编写函数求二叉树中叶子结点的个数
- 创建一个servlet
- MongoDB&C++开发(四)bsoncxx::builder::stream::document的增删改查操作