ICPC-进制与分数
文章平均质量分 90
有关进制与分数的题解
海岛Blog
专注于程序设计及其竞赛,专注于集成电路EDA设计
展开
-
UVA619 LA5465 POJ1312 HDU1314 ZOJ1272 Numerically Speaking【大数+进制】
Numerically SpeakingTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 1346 Accepted: 718DescriptionA developer of crossword puzzles (and other similar word games) has decided to develop a mapping between every possible word with from one to t原创 2021-05-07 22:37:19 · 170 阅读 · 0 评论 -
UVA275 LA5384 POJ1140 Expanding Fractions【循环节】
Expanding FractionsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3838 Accepted: 1468DescriptionIn this problem you are to print the decimal expansion of a quotient of two integers. As you well know, the decimal expansions of many integer原创 2021-05-05 06:05:31 · 233 阅读 · 0 评论 -
POJ3979 分数加减法【水题】
分数加减法Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 18176 Accepted: 5643Description编写一个C程序,实现两个分数的加减法Input输入包含多行数据每行数据是一个字符串,格式是"a/boc/d"。其中a, b, c, d是一个0-9的整数。o是运算符"+“或者”-"。数据以EOF结束输入数据保证合法Output对于输入数据的每一行输出两个分数的运算结果。注意结果应符合书写习惯,原创 2020-09-30 06:52:56 · 478 阅读 · 0 评论 -
HDU2100 Lovekey【大数+进制】
LovekeyTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11215 Accepted Submission(s): 3636Problem DescriptionXYZ-26进制数是一个每位都是大写字母的数字。 A、B、C、…、X、Y、Z 分别依次代表一个0 ~ 25 的数字,一个 n 位的26进制数转化成是10进制的规则如下A原创 2020-06-14 00:14:57 · 414 阅读 · 0 评论 -
UVA324 LA5432 POJ1454 Factorial Frequencies【大数+进制】
Factorial FrequenciesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 2927 Accepted: 1252DescriptionIn an attempt to bolster her sagging palm-reading business, Madam Phoenix has decided...原创 2020-04-26 01:11:11 · 284 阅读 · 0 评论 -
UVA10193 All You Need Is Love【进制+GCD】
”All you need is love. All you need is love.All you need is love, love… love is all you need.”The BeatlesThere was invented a new powerfull gadget by the International Beautifull Machines corporati...原创 2020-03-02 23:08:12 · 390 阅读 · 0 评论 -
HDU2522 A simple problem【分数与小数】
A simple problemTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6578 Accepted Submission(s): 2333Problem DescriptionZty很痴迷数学问题.。一天,yifenf...原创 2019-11-24 01:29:34 · 670 阅读 · 0 评论 -
ZOJ1154 Niven Numbers【进制】
Niven NumbersTime Limit: 2 Seconds Memory Limit: 65536 KBA Niven number is a number such that the sum of its digits divides itself. For example, 111 is a Niven number because the sum of its dig...原创 2019-02-08 08:21:43 · 354 阅读 · 0 评论 -
HDU1887 ZOJ2982 UVALive3958 Weird Numbers【进制】
Weird NumbersTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 594 Accepted Submission(s): 185Problem DescriptionBinary numbers form the pr...原创 2019-02-15 19:15:14 · 318 阅读 · 0 评论 -
UVA948 Fibonaccimal Base【进制】
The well known Fibonacci sequence is obtained by starting with 0 and 1 and then adding the two last numbers to get the next one. For example the third number in the sequence is 1 (1=1+0), the forth is...原创 2019-02-13 23:16:08 · 293 阅读 · 0 评论 -
UVA550 UVALive5566 Multiplying by Rotation【进制+迭代】
Warning: Not all numbers in this problem are decimal numbers!Multiplication of natural numbers in general is a cumbersome operation. In some cases however the product can be obtained by moving the la...原创 2019-02-20 10:11:56 · 314 阅读 · 0 评论 -
UVA188 LA5512 Perfect Hash【进制】
Perfect Software, Inc. has obtained a government contract to examine text flowing through a highspeed network for the occurrence of certain words. Your boss, Wally Perfect, has designed a parallel pro...原创 2019-05-30 08:39:41 · 371 阅读 · 0 评论 -
POJ2305 ZOJ1929 UVA10551 Basic remains【进制+大数模除】
Basic remainsTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 5619 Accepted: 2414 DescriptionGiven a base b and two non-negative base b integers p and m, compute p mo...原创 2018-08-17 21:35:33 · 392 阅读 · 0 评论 -
HDU1172 猜数字【暴力+进制】
猜数字Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7025 Accepted Submission(s): 3829Problem Description猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随...原创 2018-06-30 11:01:27 · 800 阅读 · 0 评论 -
UVA10922 2 the 9s【大数模除+进制】
A well-known trick to know if an integer N is a multiple of nine is to compute the sum S of its digits. If S is a multiple of nine, then so is N. This is a recursive test, and the depth of the recursi...原创 2018-05-03 08:48:37 · 656 阅读 · 0 评论 -
UVA10931 Parity【进制】
We define the parity of an integer n as the sum of the bits in binary representation computed modulo two. As an example, the number 21 = 101012 has three 1s in its binary representation so it has pari...原创 2018-05-03 07:57:49 · 635 阅读 · 0 评论 -
UVALive6222 Unhappy Numbers【数学】(RE)
Numbers have feelings too! For any positive integer, take the sum of the squares of each of its digits, and add them together. Take the result, and do it again. A number is Happy if, after repeating t...原创 2018-04-25 09:07:31 · 392 阅读 · 0 评论 -
UVALive8091 Happy Number【数学】
Consider the following function f defined for any natural number n:f(n) is the number obtained by summing up the squares of the digits of n in decimal (or base-ten). If n = 19, for example, then f(19...原创 2018-04-25 06:48:43 · 359 阅读 · 0 评论 -
UVA10591 Happy Number【数学】
Let the sum of the square of the digits of a positive integer S0 be represented by S1. In a similar way, let the sum of the squares of the digits of S1 be represented by S2 and so on. If Si = 1 for so...原创 2018-04-25 06:32:23 · 528 阅读 · 0 评论 -
UVA11121 Base -2【-2进制】
The creator of the universe works in mysterious ways. But he uses a base ten counting system and likes round numbers.**Scott Adams**Everyone knows about base 2 (binary) integers and base 10 (decima...原创 2019-03-02 19:55:16 · 523 阅读 · 0 评论 -
UVA332 LA5440 Rational Numbers from Repeating Fractions【循环小数转分数+GCD】
A rational number is any which can be written in the form p/q, where p and q are integers. All rational numbers less than 1 (that is, those for which p is less than q) can be expanded into a decimal f...原创 2019-03-20 22:24:02 · 440 阅读 · 0 评论 -
UVA12527 LA6134 Different Digits【前缀和+进制】
The inhabitants of Nlogonia are very superstitious. One of their beliefs is that street house numbers that have a repeated digit bring bad luck for the residents. Therefore, they would never live in a...原创 2019-04-08 09:26:54 · 368 阅读 · 0 评论 -
SPOJ-NEG2 POJ3191 The Moronic Cowmpouter【进制】
Inexperienced in the digital arts, the cows tried to build a calculating engine (yes, it’s a cowmpouter) using binary numbers (base 2) but instead built one based on base negative 2! They were quite p...原创 2019-07-28 07:43:31 · 273 阅读 · 0 评论 -
UVA11398 The Base-1 Number System【进制】
As we know, in an n-based number system, there are n different types of digits. In this way, a 1-based number system has only 1 type of digit, the ‘0’. Here are the rules to interpret 1-based numbers....原创 2019-07-28 07:21:33 · 373 阅读 · 0 评论 -
UVA636 Squares (III)【进制】
A few days earlier a certain mathematician had been fired from his job so he has made up his mind to take revenge on his former employers and has changed all the numbers in their databases to their co...原创 2019-08-01 09:36:06 · 225 阅读 · 0 评论 -
UVA11185 Ternary【进制】
You will be given a decimal number. You will have to convert it to its ternary (Base 3) equivalent.InputThe input file contains at most 100 lines of inputs. Each line contains a non-negative decimal...原创 2019-08-04 23:10:32 · 245 阅读 · 0 评论 -
UVA290 Palindroms smordnilaP【进制+回文】
The following problem deals with Palindroms composed of digits. A number is a palindrom, if the sequence of signs (digits or characters) read from left to right and read from right to left are identic...原创 2019-08-04 22:54:10 · 246 阅读 · 0 评论 -
UVA11952 Arithmetic【进制】
Alice is really bad at arithmetic. Sometimes she can’t properly add two single-digit numbers withoutusing a computer! It is quite embarrassing, so she comes up with silly explanations when someone sp...原创 2019-08-04 22:24:30 · 236 阅读 · 0 评论 -
UVA446 Kibbles "n" Bits "n" Bits "n" Bits【进制+位操作】
A certain frazzled programmer is writing a program that receives two numbers at a time in hexadecimal form, performs an addition or subtraction on them, and outputs the result in decimal form. However...原创 2019-08-04 10:15:05 · 313 阅读 · 0 评论 -
UVA10677 POJ3027 Base Equality【进制】
Base equalityTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 891 Accepted: 537DescriptionNumerous are the moments I as a programmer have been frustrated by the tedious conversions betw...原创 2019-07-30 11:28:56 · 255 阅读 · 0 评论 -
UVA12602 Nice Licence Plates【进制】
Alberta licence plates currently have a format of ABC-0123 (three letters followed by four digits). We say that the licence plate is “nice” if the absolute difference between t...原创 2019-07-29 05:47:50 · 550 阅读 · 2 评论 -
UVA11787 Numeral Hieroglyphs【数制】
Egyptians had a writing system based on hieroglyphs from around 3000 BC. Hieroglyphs are small drawings representing words. Besides, Egyptians had a base 10 system of hieroglyphs for numerals. That is...原创 2019-04-15 09:36:48 · 411 阅读 · 0 评论 -
UVA10101 Bangla Numbers【进制+递归】
Bangla numbers normally use ’kuti’ (10000000), ’lakh’ (100000), ’hajar’ (1000), ’shata’ (100) while expanding and converting to text. You are going to write a program to convert a given number to text...原创 2019-04-20 21:32:19 · 486 阅读 · 0 评论 -
UVA944 Happy Numbers【数学】
Let the sum of the squares of the digits of a positive integer s0 be represented by s1. In a similar way, let the sum of the squares of the digits of s1 be represented by s2, and so on. If si = 1 for ...原创 2018-02-17 23:11:02 · 638 阅读 · 0 评论 -
POJ1565 ZOJ1712 UVA575 UVALive5320 Skew Binary【进制】
Skew BinaryTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11253 Accepted: 7165DescriptionWhen a number is expressed in decimal, the kth digit represents a multiple of 10k. (Digits are numbe...原创 2018-04-08 23:28:02 · 473 阅读 · 0 评论 -
HDU1230 火星A+B【进制】
火星A+BTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13121 Accepted Submission(s): 4510Problem Description读入两个不超过25位的火星正整数A和B,计算A原创 2016-05-27 22:32:56 · 2709 阅读 · 5 评论 -
HDU2106 decimal system【进制+字符串切割】
decimal systemTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5184 Accepted Submission(s): 3005Problem DescriptionAs we know , we原创 2016-07-13 22:15:52 · 1650 阅读 · 0 评论 -
HDU1720 A+B Coming]【十六进制】
A+B ComingTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10146 Accepted Submission(s): 6594Problem DescriptionMany classmates sa原创 2016-07-27 01:08:24 · 1791 阅读 · 0 评论 -
HDU2352 Verdis Quo【记数法转换+罗马数字】
Verdis QuoTime Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1405 Accepted Submission(s): 1026Problem DescriptionThe Romans used let原创 2016-07-17 08:32:45 · 1982 阅读 · 0 评论 -
HDU2051 Bitset【进制】
BitsetTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 25032 Accepted Submission(s): 18577Problem DescriptionGive you a number on原创 2016-07-10 08:15:12 · 2146 阅读 · 0 评论