D. Ability To Convert time limit per test 1 second Cmemory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English le…
Ability To Convert 题意:给你一个n进制的60位的数,但是由于Alexander只会写0->9,所以他就会用10来表示十而不是A(假设进制>10); 题解:模拟就好了,先走往前走进制的位数的倍数,再判断一下首位是不是0,或者这个数有没有大于等于进制,如果有就不行,就要往后走,走到一个非0开头的点,或者就是走到只有1个0的点,然后算出目前这段区间的答案加一个倍数就好了. 代码: #include<bits/stdc++.h> using namespace std;…
D - Ability To Convert 题目大意:给你一个数字 n 接下来再输入一个数字 w(<10^60),表示w这个数字是 n 进制的, 并且超过十进制也用数字表示,这样就有多种组合了,问你所有组合中(划分方案中)原来的 数字十进制最小是多少. 思路:网上说可以用贪心做,但是我感觉那个贪心比较奇怪,不是很理解,还是用dp靠谱. 用dp[ i ] 表示从到第 i 个数字为止,最小十进制数最小是多少. 初始状态 dp[ 0 ]=0.然后我们枚举起点向后更新. #include<bits/…
D. Ability To Convert time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English let…
D. Ability To Convert time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any other, however, he doesn't know English let…
http://codeforces.com/contest/758/problem/D D. Ability To Convert time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Alexander is learning how to convert numbers from the decimal system to any…