[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 ...
随机推荐
- Flask基础-01.Flask简介
Flask简介 Web应用程序作用 Web(World Wide Web)诞生最初的目的,是为了利用互联网交流工作文档. 关于Web框架 1. 什么是Web框架? 1. 已经封装好了一段代码,协助程序 ...
- golang方法详解
Go 语言 类型方法是一种对类型行为的封装 .Go 语言的方法非常纯粹, 可以看作特殊类型的函数,其显式地将对象实例或指针作为函数的第一个参数,并且参数可以自己指定,而不强制要求一定是 this或se ...
- [Java网络安全系列面试题] GET 和 POST 的区别在哪里?
一. 概述 本文的内容源自其他博客的总结,属于笔者的读书笔记,结构如下: HTTP 的请求报文 GET 方法的特点 POST 方法的特点 GET 和 POST 的区别 二. HTTP 的请求报文 首先 ...
- ViewDragHelper的点击事件处理
在上一篇ViewDragHelper的介绍后,已经完成了自定义控件SwipeLayout的滑动,这一篇,我们来处理它的点击事件.之前提到过,它有两个子view,最开始显示的是surfaceLayout ...
- Mac安装多版本JDK
0. 配置JDK环境 安装完成之后,配置.bash_profile文件 使用source ./bash_profile激活 2. 如何切换默认的jdk? 使用java -version就可以看默认版本 ...
- SweetAlert - 演示6种不同的提示框效果
http://www.sucaihuo.com/js/190.html http://www.cnblogs.com/beiz/p/5238124.html
- php 可变变量 $$name
//可变变量 $name = 'abc'; $$name = '; echo $name . "<br/>"; // abc echo $$name . echo $a ...
- 虚拟化KVM之优化(三)
KVM的优化 1.1 cpu的优化 inter的cpu的运行级别,(Ring2和Ring1暂时没什么用)Ring3为用户态,Ring0为内核态 Ring3的用户态是没有权限管理硬件的,需要切换到内核态 ...
- SpringBoot应用操作Rabbitmq
记录RabbitMQ的简单应用 1.springboot项目中引入maven包,也是springboot官方的插件 <dependency> <groupId>org.spri ...
- visual stdio 2012快捷键
为什么80%的码农都做不了架构师?>>> VS2012变化的快捷键:注释::VS2010是(Ctrl+E,C),VS2012是(Ctrl+K, Ctrl+C),实际操作,按住Ct ...