如何把一个zip文件转化成三进制转化数的形式,比如输入a.zip 输出为一串三进制转化数就像1122

一个自然数,在三进制中的数字和是24,它在九进制中数字和最小是多少?最大是多少?
血刺sink1385
三进制中的数字和是24,则在三进制中,最大的数表示为,(24个1),最小的数表示为(12个2)那么九进制中数字和最大是:(两个一组)(三进制中的11就是9进制中的4)(12个4)最小的是 :(三进制中的22就是9进制中的8)888888
好心人 你好
数字和最小是多少?最大是多少?都是48?
哦,是和吗
最大是72,最小是24
当这个三进制数是
101010......10时,(有24个1和24个0),九进制就是333...3(有24个3)
这个九进制数最大
当这个三进制数是
101010......1时,(有24个1和23个0),九进制就是111...1(有24个1)
这个九进制数最小
也可能出现很多种情况呀!比如有12个2 等等,为什么101010.....(有24个1和24个0)最大,101010.........(有24个1和23个0)最小
是一样的,
202020....20也是最大是72
2222........(连续12个2)九进制是48吗?
2222........(连续12个2)
=888.....(连续6个8)
和是48,但不是最大,最大的是
202020.......(12个2和12个0)(3进制)
=6666......(连续12个6)
和是72也是最大
还有很多啊!比如由24个1,50个0组成的三进制数字和是24, 4个1,10个2组成的三进制数字和是24,6个1.9个2组成的三进制的数字和也是24等等 很多。有什么理由可以肯定最大是72,最小是48吗? 谢谢
为您推荐:
其他类似问题
我想了解下,3进制怎么会出现24呢?
3进制中只有0,1,2何来的4?我们知道每2位3进制数可以表示1位9进制数转化关系:3进制
9进制00 = 001 = 102 = 210 = 311 = 412 = 520 = 621 = 722 = 8由此可见,要想求得9进制最大的...
经编程穷举1000个符合要求的最小自然数,在三进制中的数字和是24,它在九进制中数字和最小是24,最大是72。三进制数从右边最低位起,向左每两位三进制数对应于一位九进制数:三进制数1010101...),其对应的九进制数是1111...11(24个1),在九进制中数字和最小是24。三进制数202020...20(12个20),其对应的九进制...
扫描下载二维码hdu3001――Travelling 三进制TSP,
Travelling
Time Limit:
MS (/Others)
Memory Limit:
K (Java/Others)
Total Submission(s): 4106
Accepted Submission(s): 1310
Problem Description
After coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does not mind which city being his start station because superman
can bring him to any city at first but only once.), and of course there are m roads here,following a fee as usual.But Mr Acmer gets bored so easily that he doesn't want to visit a city more than twice!And he is so mean that he wants to minimize the total fee!He
is lazy you see.So he turns to you for help.
There are several test cases,the first line is two intergers n(1<=n<=10) and m,which means he needs to visit n cities and there are m roads he can choose,then m lines follow,each line will include three intergers a,b and c(1<=a,b<=n),means
there is a road between a and b and the cost is of course c.Input to the End Of File.
Output the minimum fee that he should pay,or -1 if he can't find such a route.
Sample Input
Sample Output
2009 Multi-University Training Contest 11 - Host by HRBEU
We have carefully selected several similar problems for you:
这题一看就是TSP,然后想到要状压,但是这里每个城市最多可以走两次,所以不能用普通的二进制来状压,需要三进制
三进制每一位是0 1 2, 0表示这座城市没到过,1表示到过一次,2表示到过两次
由于一共10座城市,我们先把3^0 --- 3 ^ 10预处理出来,然后化作三进制存好,接着就是dp,但是要注意,可以作为最后状态的状态,它的每一位都不为0(否则就有某个城市没到过),最后枚举所有可以作为尾状态的状态然后求个最小&#20540;就ok了
const int inf = 0x3f3f3f3f;
int dp[60000][15];
int dist[15][15];
int three[15] = {0, 1, 3, 9, 27, 81, 243, 729, , 1};
int city[60000][15];
int main()
int n, m, u, v,
memset (city, inf, sizeof(city));
for (int i = 0; i < 59059; ++i)
for (int j = 1; j <= 10; ++j)
city[i][j] = tmp % 3;
while (~scanf("%d%d", &n, &m))
memset (dist, inf, sizeof(dist));
memset (dp, inf, sizeof(dp));
for (int i = 1; i <= ++i)
dp[three[i]][i] = 0;
dp[0][0] = 0;
for (int i = 1; i <= ++i)
scanf("%d%d%d", &u, &v, &w);
dist[u][v] = min(dist[u][v], w);
dist[v][u] = dist[u][v];
for (int i = 0; i < three[n + 1]; ++i)
bool is_end = 1;
for (int j = 1; j <= ++j)
if (city[i][j] == 0)
is_end = 0;
for (int k = 1; k <= 10; ++k)
if (city[i][j] == 2)
dp[i + three[j]][j] = min(dp[i + three[j]][j], dp[i][k] + dist[k][j]);
if (is_end)
for (int j = 1; j <= ++j)
ans = min(ans, dp[i][j]);
if (ans == inf)
printf("-1\n");
printf("%d\n", ans);
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'1.3.2算法案例-进位制 (高中数学人教A版必修三)_图文_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
1.3.2算法案例-进位制 (高中数学人教A版必修三)
上传于||暂无简介
大小:465.00KB
登录百度文库,专享文档复制特权,财富值每天免费拿!
你可能喜欢下列符号组合________可能是一个三进制数.ababdacbbca我觉得这两个答案都对啊?有什么不同吗
acbbca因为三进制数只有0、1、2三个数字而ababd已经有a、b、d,还有可能有c,即4个数
就是说一定要按顺序来的是吗?不可以随便取的是吗?
那汉字就可以随便取了吗?
可能性大小问题
它不是也没有说一定是三进制吗
恩,对呀.谢谢.
为您推荐:
其他类似问题
扫描下载二维码怎样编写一程序:把一个十进制数转换成三进制数啊三进制数用符号"-,0.1"表示.比如三进制数是 -0表示十进制的数 (-2)
三进制数是101表示十进制的数 (10)希望把程序过程写出来,把算法写好,越具体越好,谢谢拉
1、二进制数、八进制数、十六进制数转十进制数
有一个公式:二进制数、八进制数、十六进制数的各位数字分别乖以各自的基数的(N-1)次方,其和相加之和便是相应的十进制数。个位,N=1;十位,N=2...举例:
110B=1*2的2次方+1*2的1次方+0*2的0次方=0+4+2+0=6D
110Q=1*8的2次方+1*8的1次方+0*8的0次方=64+8+0=72D
110H=1*16...
void main ()
int a[32],i,j=0,n;
printf ("please input the n: ");
scanf ("%d",&n);
printf ("十进制数 %d 转换成二进制数是:",n);
for (i=0;i=0;i--)
printf ("%d",a[i]);
printf ("\n");
enum three{zero=0,one=1,two=2};//枚举的三进制数据类型
void main(void)
bool zhengshu=//用来存放变量标记是否为正数
if(a0);//逆序转化
if(zhengshu==false)
int a[100]; void func(int x)//x此处是10进制数,转化成三进制 { int i=0; while(x!=0) { a[i]=x%3; x/=3; i++; } for(int k=i-1;k>=0;k--) { cout
好像有个库函数是itoa吧,可以在任意进制之间转换。
为您推荐:
扫描下载二维码

我要回帖

更多关于 小数转化为二进制 的文章

 

随机推荐