我们知道任意进制转换为十进制,都是乘以基数的多少次方,然后相加: 十进制转换为任意进制,都是除以基数,然后倒着取余数: 所以这里是用十进制数中转,实现任意进制数的转换 #include<iostream> #include<algorithm> #include<math.h> #include<stack> #define ll long long #define M 0x3f3f3f3f3f using namespace std; ll change1
C - Pashmak and Buses Codeforces Round #261 (Div. 2) C. Pashmak and Buses time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Recently Pashmak has been employed in a transportation company. The