The fraction 49/98 is a curious fraction, as an inexperienced mathematician in attempting to simplify it may incorrectly believe that49/98 = 4/8, which is correct, is obtained by cancelling the 9s.
We shall consider fractions like, 30/50 = 3/5, to be trivial examples.
There are exactly four non-trivial examples of this type of fraction, less than one in value, and containing two digits in the numerator and denominator.
If the product of these four fractions is given in its lowest common terms, find the value of the denominator.
题目大意:
分数 49/98 是一个奇怪的分数:当一个菜鸟数学家试图对其进行简化时,他可能会错误地可以认为通过将分子和分母上的9同时去除得到 49/98 = 4/8。但他得到的结果却是正确的。
我们将30/50 = 3/5这样的分数作为普通个例。
一共有四个这样的非普通分数,其值小于1,并且包括分子和分母都包括2位数。
如果将这四个分数的乘积约分到最简式,分母是多少?
#include<stdio.h> #include<string.h> #include<math.h> #include<ctype.h> #include<stdlib.h> #include<stdbool.h> void swap(int *a, int *b) { int t; t=*a; *a=*b; *b=t; } int gcd(int a, int b) { int r; if (a < b) swap(&a,&b); if (!b) return a; while ((r = a % b) != 0) { a = b; b = r; } return b; } void find() { int i; int M,N; M=N=1; for(i=12; i<50; i++) { for(int j=i+1; j<100; j++) { int t=gcd(i,j); if(t==1 || i/t>10 || j/t>10 || i%10!=j/10) continue; else { int a=i/10,b=j%10; if(a/gcd(a,b)==i/t && b/gcd(a,b)==j/t) { M*=i/t; N*=j/t; } } } } printf("%d\n",N/gcd(M,N)); } int main() { find(); return 0; }
Answer:
|
100 |
相关推荐
今天写的Digit Recognizer属于练习项目,最后的结果只按照测试集的正确率计算排名,没有奖励。解决方案的python代码在Github开源平台上。 Digit Recognizer任务 此任务是在MNIST(一个带Label的数字像素集合)上训练...
is a hard problem. In this paper, we address an equally hard sub-problem in this domain viz. recognizing arbitrary multi-digit numbers from Street View imagery. Traditional approaches to solve this ...
1164:digit函数 时间限制: 1000 ms 内存限制: 65536 KB 提交数: 32194 通过数: 20739 【题目描述】 在程序中定义一函数digit(n,k) ,它能分离出整数n 从右边数第k 个数字。 【输入】 正整数n 和k 。 【输出】 一...
基于python实现的利用kNN实现Digit Recognition,分别从1. 准备数据,对数据进行预处理 2. 选用合适的数据结构存储训练数据和测试元组 3. 设定参数,如k 4.维护一个大小为k的的按距离由大到小的优先级队列,用于存储...
Parallels Desktop 17.1.1 for M1 M1pro (解压码digit77.com).dmg mac电脑M1系列芯片电脑
电子时钟字体文件electronicFont DS-DIGIT.TTF
Digit Recognizer手写数字识别的MINST数据集:包含三个数据文件 sample_submission.csv,test.csv,train.csv
kaggle 竞赛中的手写体数字识别数据集,Digit Recognizes数据集,分为test.csv和train.csv
matlab code for digit recognition
kaggle digit-recoginzer 数字识别数据,用于入门的手写数字识别,常用的deep learning,神经网络,机器学习数据集
matlab开发-NACA4digit。NACA 4位翼型绘图仪。
一款数码字体,类似于电子手表的字体样式,带HTML使用示例。使用时首先要引入DS-DIGIT.TTF字体文件,在HTMLcss样式添加 font-family:electronicFont;便可生效。 好像不兼容IE浏览器,谷歌使用正常
本指标实现了一个突破系统,它使用了基于 JSatl_Digit 算法处理的最高价和最低价的序列形成的通道。
HTM 算法,On the Optimum Architecture of the Biologically Inspired Hierarchical Temporal Memory Model Applied to the Hand-Written Digit Recognition
指标 ColorJFatl_Digit 在输入参数中有时间帧选项。
基于 JSatl_Digit_System 指标信号的交易系统。
Tensorflow入门,手写数字图片识别数据集,从https://www.kaggle.com/c/digit-recognizer下载的 包含train.csv,test.csv,sample_submission.csv 从官网下载要注册而且慢=。=