package com.njupt.acm; import java.math.BigInteger; import java.util.Scanner; public class POJ_1220_1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); while(t > 0){ BigInteger ba1 = scann…
题目连接:1220 NUMBER BASE CONVERSION 题目大意:给出两个进制oldBase 和newBase, 以及以oldBase进制存在的数.要求将这个oldBase进制的数转换成newBase进制的数. 解题思路:短除法,只不过时直接利用了高精度的除法运算, 并且将以前默认的*10换成的*oldBase. #include <stdio.h> #include <string.h> const int N = 1005; int newBase, oldBase,…
NUMBER BASE CONVERSION Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5976   Accepted: 2738 Description Write a program to convert numbers in one base to numbers in a second base. There are 62 different digits: { 0-9,A-Z,a-z } HINT: If…
题目链接 题意 : 给你一个a进制的数串s,让你转化成b进制的输出. A = 10, B = 11, ..., Z = 35, a = 36, b = 37, ..., z = 61,0到9还是原来的含义. 思路 : 这个题因为牵扯了英文字母所以比较复杂一点,先将所有出现的英文字母转化成他们所代表的数,然后进行进制转换. //POJ 1220 #include <stdio.h> #include <string.h> #include <iostream> #incl…
Description Write a program to convert numbers in one base to numbers in a second base. There are 62 different digits: { 0-9,A-Z,a-z } HINT: If you make a sequence of base conversions using the output of one conversion as the input to the next, when…
Judge Info Memory Limit: 32768KB Case Time Limit: 1000MS Time Limit: 1000MS Judger: Number Only Judger Description 现在假设: 2进制对应的基数是0,1; 3进制对应的基数是0,1,2; …… 10进制对应的基数是0,1,2,3,4,5,6,7,8,9. …… n进制对应的基数是0,1,2,3,……,n-1; 你的任务是实现进制之间的转换. Input 第一行,有t(t<=1000)…
题意 Write a program to convert numbers in one base to numbers in a second base. There are 62 different digits: { 0-9,A-Z,a-z } HINT: If you make a sequence of base conversions using the output of one conversion as the input to the next, when you get b…
题意 任意进制之间的高进的转换 思路 相模倒排,高精处理 代码 我太弱了,下面附一个讨论里发的maigo思路的代码 ],A[]; ],d[]; main(){ for(scanf("%d",&T);T--;){ scanf("%d%d%s",&a,&b,s); <i--;)t[k--i]=s[i]-(s[i]<?:s[i]<?:); ;k;){ <i--;){ t[i-]+=t[i]%b*a; t[i]/=b; } A…
数组存储整数,模拟手算进行四则运算 阶乘精确值 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #include<stdio.h> #include<string.h> const int maxn=3000; int f[maxn]; int main() {         int i,j,n;        scanf( "%d",&n);        me…
http://poj.org/problem?id=1220 题意:进制转换,把a进制转换为b进制. 如果数据不大的话,那么这个题还是很简单的,但这个题就是数据范围太大,所以这里可以采用短除法来做. 关于短除法,就是把每一位(这里指的每一位是指个位十位之类的)除以要转换的进制的余数在乘以当前进制的值加到下一位去,当前位的值就为商,然后这样一直进行到最后一位(也就是个位)个位在对所须转换的进制在取模,那么这个模就是转换后的结果.多次重复,直到最后一位为0,从后往前看就是答案. 举个例子:50,要从…