[csu1392]YY一下
题意:给定x,求有多少个10^8以内的数满足这个数乘以x以后,最高位到了最低位。设最高位的数字和剩余长度,列等式推理即可。
#pragma comment(linker, "/STACK:10240000,10240000") #include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <map>
#include <queue>
#include <deque>
#include <cmath>
#include <vector>
#include <ctime>
#include <cctype>
#include <set> using namespace std; #define mem0(a) memset(a, 0, sizeof(a))
#define lson l, m, rt << 1
#define rson m + 1, r, rt << 1 | 1
#define define_m int m = (l + r) >> 1
#define Rep(a, b) for(int a = 0; a < b; a++)
#define lowbit(x) ((x) & (-(x)))
#define constructInt4(name, a, b, c, d) name(int a = 0, int b = 0, int c = 0, int d = 0): a(a), b(b), c(c), d(d) {}
#define constructInt3(name, a, b, c) name(int a = 0, int b = 0, int c = 0): a(a), b(b), c(c) {}
#define constructInt2(name, a, b) name(int a = 0, int b = 0): a(a), b(b) {} typedef double db;
typedef long long LL;
typedef pair<int, int> pii;
typedef multiset<int> msi;
typedef multiset<int>::iterator msii;
typedef set<int> si;
typedef set<int>::iterator sii;
typedef vector<int> vi; const int dx[] = {, , -, , , , -, -};
const int dy[] = {, -, , , -, , , -};
const int maxn = 1e5 + ;
const int maxm = 1e5 + ;
const int maxv = 1e7 + ;
const int MD = 1e9 +;
const int INF = 1e9 + ;
const double PI = acos(-1.0);
const double eps = 1e-; int digit(LL x) {
int cnt = ;
while (x) {
cnt++;
x /= ;
}
return cnt;
} int main() {
//freopen("in.txt", "r", stdin);
double tx;
while (cin >> tx) {
LL x = (int)(tx * + 0.5), get = ;
if (x >= ) {
puts("No solution");
continue;
}
LL p = ;
for (int i = ; i <= ; i++) {
for (int k = ; k <= ; k++) {
LL tmp = k * (x * p - 1e4);
if (tmp % (LL)(1e5 - x)) continue;
tmp /= 1e5 - x;
if (digit(tmp) == i) {
printf("%d", k);
if (tmp > ) printf("%d", tmp);
puts("");
get = ;
}
}
p *= ;
}
if (!get) puts("No solution");
}
return ;
}
[csu1392]YY一下的更多相关文章
- 【需求设计1】VIP积分系统无聊YY
RT,想到什么就写什么呗,这是最简单的方式,顺便给自己做一个记录,反正自己记忆力也不太好.本文是仿陆金所的积分系统,自己YY的一套东西. 首先我想做一个VIP兑换投资卷的功能: 我们先来确定一些我知道 ...
- YY一下十年后的自己
ps:其实这篇文章的评论比文章本身更有意思,欢迎关注. 每到年底总是我最焦虑的时候,年龄越大情况越明显. 可能越长大越是对 时光的流逝 更有感触,有感触之后就会胡思乱想.所以随手开始写下这篇文章. 人 ...
- BZOJ 2820: YY的GCD [莫比乌斯反演]【学习笔记】
2820: YY的GCD Time Limit: 10 Sec Memory Limit: 512 MBSubmit: 1624 Solved: 853[Submit][Status][Discu ...
- YY一下淘宝商品模型
淘宝的电商产品种类非常丰富,必然得力于其商品模型的高度通用性和扩展性. 下面我将亲自操作淘宝商品的发布过程,结合网上其他博客对淘宝网商品库的分析,简单谈谈我的理解. 注:下面不特殊说明,各个表除主键外 ...
- 我YY的一个移动应用运营模式
尽管自己也还是刚刚毕业不久的前端新人,但网上也不乏一些案例告诉我们有志不在年高,很多优秀的同龄人已经有了不错的成就,所以在切页面写onclick之余也在进行一些思考,前端程序员的出路到底在哪里? 一. ...
- YY游戏私有云平台实践 (转自InfoQ )
作者 风河 发布于 2016年1月13日 | 讨论 编者按:YY游戏的页游早在2013年就在云平台上运行,其Cloud 1.0已经支撑几十万的同时在线用户.日前,YY游戏云平台进行了Cloud 2 ...
- 51nod 1422(强行YY)
1422 沙拉酱前缀 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 40 难度:4级算法题 收藏 关注 沙拉酱非常喜欢数字序列.这正是他要弄一个关于 ...
- js时间格式化(yy年MM月dd日 hh:mm)
//时间格式化 Date.prototype.format = function (format) { var o = { "M+": this.getMonth() + 1, / ...
- G - YY's new problem(HUSH算法,目前还不懂什么是HUSH算法)
Time Limit:4000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Pra ...
随机推荐
- CentOS7.7下二进制部署MySQL多版本多实例实战
第一章 需求说明 部署MySQL5.7的三个多实例环境(端口分别为3307,3308,3309) 部署MySQL5.6和8.0版本数据库实例((端口分别为3316和3326) 第二章 环境准备 1.虚 ...
- [Asp.Net Core] Blazor Server Side 项目实践 - 切换页面时保留状态
前言: 这是 项目实践系列 , 算是中高级系列博文, 用于为项目开发过程中不好解决的问题提出解决方案的. 不属于入门级系列. 解释起来也比较跳跃, 只讲重点. 因为有网友的项目需求, 所以提前把这些解 ...
- Docker 安装 Jenkins , 并解决初始安装插件失败
安装 Jenkins 后,初始化下载插件总是失败,导致安装不成功,重试好几次都是卡在安装插件那. 这里记录下 Docker 下怎么安装 Jenkins ,并解决初始安装插件失败问题. 安装插件失败,其 ...
- Java面试系列第3篇-HashMap相关面试题
HashMap是非线程安全的,如果想要用线程安全的map,可使用同步的HashTable或通过Collections.synchronizeMap(hashMap)让HashMap变的同步,或者使用并 ...
- mysql插入数字都变成2147483647的解决方法
2147483647是int类型的最大值,所以插入11位的数字都会变成2147483647,把int改为bigint即可
- 设置共享内存大小 【windows】
hMapFile = CreateFileMapping( INVALID_HANDLE_VALUE, // use paging file NULL, // default security PAG ...
- Makefile 中引用多个 include 路径
LIB=-L/usr/informix/lib/c++ INC=-I/usr/informix/incl/c++ -I/opt/informix/incl/public default: main m ...
- Window+Protobuf使用说明
Window+Protobuf使用说明 C++WindowCmakeProtocbuf 介绍 起因 由于项目中要用到二进制存储数据,之前使用的方式是按照字节数依次将数据写入字节流中, 但是这样做起来做 ...
- js 实现淘宝无缝轮播图效果,可更改配置参数 带完整版解析代码[slider.js]
前言: 本人纯小白一个,有很多地方理解的没有各位大牛那么透彻,如有错误,请各位大牛指出斧正!小弟感激不尽. 本篇文章为您分析一下原生JS写淘宝无缝轮播图效果 需求分析: ...
- js之用IndexOf返回指定字符串的次数
代码 var Str = "strs,strs,stras,str,strs,strs"; var subStr ="strs" ; var count = 0 ...