1. L1-006 连续因子(20)(思路+测试点分析)(1) 2. PAT 1084 外观数列(20)(代码+思路+推荐测试用例)(1) 1023 Have Fun with Numbers(20 分) Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913...
with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number consisting exactly the numbers from 1 to 9, only in a different permutation. Check to see the result if we double it again!
with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number consisting exactly the numbers from 1 to 9, only in a different permutation. Check to see the result if we double it again!
1、用散列,散列到每个数,并且有一个num++, 2、然后大整数乘法 3、再判断每个数是否散列中的数,如果是,则减减,并且num--,最后判断num是否为0 learn && wrong: 1、 标准答案不是我的散列, (1)是先比较两个数长度是否相同, (2)相同则,先让a.d[i]在count散列数组++,另外一个--, (3)最后遍历一次coun...
#include<iostream>#include<cstdio>#include<string>#include<string.h>#include<algorithm>usingnamespacestd;intmain(){#if ONLINE_JUDGE#elsefreopen("input.txt","r",stdin);#endifcharinput[21];scanf("%s",input);strings=input;intnum[10]={0};// 0->9boolisFun=true;for(inti=0;i<s.size()...
#include<stdio.h>#include<stdlib.h>#include<string.h>intis_same_digits(int*arr1,int*arr2){intarr_d_1[10]={0};intarr_d_2[10]={0};intd1=0,d2=0;inti;intv1,v2;for(i=0;i<21;i++){v1=arr1[i];v2=arr2[i];if(v1!=0){d1=1;}if(v2!=0){d2=1;}if(d1==1){arr...
PTA刷题笔记(C语言) | 7-49 Have Fun with Numbers (20分),开始刷题,感觉代码量和基础太渣了,导致数据结...
Now you are suppose to check if there are more numbers with this property. That is, double a given number with digits, you are to tell if the resulting number consists of only a permutation of the digits in the original number.
1023 Have Fun with Numbers (20 分) Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happens to be another 9-digit number consisting exactly the numbers from 1 to 9, only in ...
1(2分) We have fun with numbers in our___lesson. 2(1分) We have fun with numbers in our___lesson. 3(6分) We have fun with numbers in our___lesson. 4(1分)We have fun with numbers in our___lesson. 5(5分) We have fun with numbers in our___lesson.反馈 收藏 ...