 Friend Number

Given a positive integer x, let P(x) denotes the product of all x's digits. Two integers x and y are friend numbers if P(x) = P(y). Here comes the problem: Given a positive integer x, of course it has a lot of friend numbers, find the smallest one which is greater than x.
Input
There are multiple test cases. The first line of input is an integer T (0 < T < 230) indicating the number of test cases. Then T test cases follow. Each case is an integer x (0 < x <= 101000). You may assume that x has no leading zero.
Output
For each test case, output the result integer in a single line. You should not output a number with leading zero.
Sample Input
3
12
19
222
Sample Output21
33
241
thymeleaf模板如何循环数字1到10_course
20170315大神们 thymeleaf模板如何循环数字1到10？想做分页，能得到总页数，但不知道如何循环 我的代码<li th:each="i:${pageCount}"> <a th:href="@{/manage/(currentPage=${i})}" th:text="${i}"></a> </li>
leetcode 002 add two numbers C语言_course
20150514``` struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) { struct ListNode *l, *p; l = (struct ListNode*)malloc(sizeof(struct ListNode)); l>val = l1>val + l2>val; p = l; l1 = l1>next; l2 = l2>next; while(l1l2p>val>9) { p>next = (struct ListNode*)malloc(sizeof(struct ListNode)); p>next>val = p>val/10; p>val %= 10; p = p>next; if(l1) { p>val += l1>val; l1 = l1>next; } if(l2) { p>val += l2>val; l2 = l2>next; } } return l; } ``` 请问这样有错吗？我自己反复看了觉得没有问题啊，原题 如下 You are given two linked lists representing two nonnegative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 > 4 > 3) + (5 > 6 > 4) Output: 7 > 0 > 8
Ugly Numbers _course
20170801Description Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, ... shows the first 10 ugly numbers. By convention, 1 is included. Given the integer n,write a program to find and print the n'th ugly number. Input Each line of the input contains a postisive integer n (n <= 1500).Input is terminated by a line with n=0. Output For each line, output the n’th ugly number .:Don’t deal with the line with n=0. Sample Input 1 2 9 0 Sample Output 1 2 10
Sum Sum Sum _course
20170924Problem Description We call a positive number X Pnumber if there is not a positive number that is less than X and the greatest common divisor of these two numbers is bigger than 1. Now you are given a sequence of integers. You task is to calculate the sum of Pnumbers of the sequence. Input There are several test cases. In each test case: The first line contains a integer N(1≤N≤1000). The second line contains N integers. Each integer is between 1 and 1000. Output For each test case, output the sum of Pnumbers of the sequence. Sample Input 3 5 6 7 1 10 Sample Output 12 0
Nikifor _course
20171012Description Nikifor has decided to present the dean of the Department of Mathematics and Mechanics with a linearly independent vector system (you know, that we've just celebrated jubilees of the University and of the Department). A store sells m items of ndimensional vectors, m <= 2000, 3 <= n <= m. For each vector its price ci is known, 0 < i <= m. Nikifor wants to buy n linearly independent vectors paying for them minimal sum of money. Write a program that would determine which vectors Nikifor should buy or would inform that it is impossible to satisfy his requirements. Input The first line of an input contains numbers m and n separated with a space. The next m lines contain the vectors on sale. All of the coordinates are integers with an absolute value not exceeding 2 000. The numbers are separated from each other with a space. The next m lines contain prices ci, one number in each line. The prices are positive integers not exceeding 15 000. Output The first line of an output should contain the minimal amount of money that Nikifor is to pay or the number 0, if Nikifor's requirements cannot be satisfied in this store. If it is possible to make a purchase, then the next n lines should contain the numbers of the vectors that Nikifor should buy. If several sets of such numbers are possible, then you should write one of them which is minimal according to the lexicographic order. Sample Input 5 3 1 0 0 0 1 0 0 0 1 0 0 2 0 0 3 10 20 30 10 10 Sample Output 40 1 2 4
How many prime numbers _course
20170528Problem Description Give you a lot of positive integers, just to find out how many prime numbers there are. Input There are a lot of cases. In each case, there is an integer N representing the number of integers to find. Each integer won’t exceed 32bit signed integer, and each of them won’t be less than 2. Output For each case, print the number of prime numbers you have found out. Sample Input 3 2 3 4 Sample Output 2
Illumination _course
20171017Description You are given N light sources on the plane, each of which illuminates the angle of 2π/N with the vertex in the source point (including its sides). ![](http://poj.org/images/1902_1.jpg) You must choose the direction of the illuminated angle for each of these sources, so that the whole plane is illuminated. It can be proved that this is always possible. A light source itself casts no shadow and does not interfere with light beams from the other sources. Input The first line of the input file contains N  the number of light sources (3 <= N <= 30). Next N lines contain two integer numbers each  the coordinates of the light sources. All coordinates do not exceed 100 by their absolute value. No two sources coincide. Output ![](http://poj.org/images/1902_2.jpg) Print N real numbers  for each light source specify an angle that the bisector of the illuminated angle makes with OX axis, counterclockwise. Print at least six digits after the decimal point. No angle must exceed 100π by its absolute value. Sample Input 3 0 0 2 0 1 1 Sample Output 0.52359877559829887 2.61799387799149437 4.71238898038468986
How Many Fibs? _course
20170717Problem Description Recall the definition of the Fibonacci numbers: f1 := 1 f2 := 2 fn := fn1 + fn2 (n >= 3) Given two numbers a and b, calculate how many Fibonacci numbers are in the range [a, b]. Input The input contains several test cases. Each test case consists of two nonnegative integer numbers a and b. Input is terminated by a = b = 0. Otherwise, a <= b <= 10^100. The numbers a and b are given with no superfluous leading zeros. Output For each test case output on a single line the number of Fibonacci numbers fi with a <= fi <= b. Sample Input 10 100 1234567890 9876543210 0 0 Sample Output 5 4
Olympiad _course
20170306Problem Description You are one of the competitors of the Olympiad in numbers. The problem of this year relates to beatiful numbers. One integer is called beautiful if and only if all of its digitals are different (i.e. 12345 is beautiful, 11 is not beautiful and 100 is not beautiful). Every time you are asked to count how many beautiful numbers there are in the interval [a,b] (a≤b). Please be fast to get the gold medal! Input The first line of the input is a single integer T (T≤1000), indicating the number of testcases. For each test case, there are two numbers a and b, as described in the statement. It is guaranteed that 1≤a≤b≤100000. Output For each testcase, print one line indicating the answer. Sample Input 2 1 10 1 1000 Sample Output 10 738
The Lucky Numbers _course
20170214Description John and Brus are freshmen at the primary school. Their first home task is to learn some integer numbers. It is not so hard for the guys and they decide to impress their teacher by learning all lucky numbers between A and B, inclusive. As you already know from the previous year contest 4 and 7 are lucky digits, and all the other digits are not lucky. A lucky number is a number that contains only lucky digits in decimal notation. After learning all lucky numbers in [A, B] range John and Brus still have some free time and now they decide to learn additionally each lucky number N that is out of [A, B] range, but the reversed number of N is in this range. Here reversed number of N is the number N written in decimal notation, but the order of digits is reversed. For example, the reversed number of 447 is 744 and reversed number of 774474444 is 444474477. You are given integers A and B and your task is to find the total number of lucky numbers learned by John and Brus. Input The first line contains single integer T – the number of test cases. Each test case consists of a single line containing two integers A and B separated by a single space. Output For each test case print a single line containing the total number of lucky numbers learned by John and Brus. Sample Input 2 1 100 44 47 Sample Output 6 3 Hint Constraints: 1 ≤ T ≤ 74, 1 ≤ A ≤ B ≤ 100000000000000000000000000000000000000000000000 (1047).
Optimal Milking _course
20171010Description FJ has moved his K (1 <= K <= 30) milking machines out into the cow pastures among the C (1 <= C <= 200) cows. A set of paths of various lengths runs among the cows and the milking machines. The milking machine locations are named by ID numbers 1..K; the cow locations are named by ID numbers K+1..K+C. Each milking point can "process" at most M (1 <= M <= 15) cows each day. Write a program to find an assignment for each cow to some milking machine so that the distance the furthestwalking cow travels is minimized (and, of course, the milking machines are not overutilized). At least one legal assignment is possible for all input data sets. Cows can traverse several paths on the way to their milking machine. Input * Line 1: A single line with three spaceseparated integers: K, C, and M. * Lines 2.. ...: Each of these K+C lines of K+C spaceseparated integers describes the distances between pairs of various entities. The input forms a symmetric matrix. Line 2 tells the distances from milking machine 1 to each of the other entities; line 3 tells the distances from machine 2 to each of the other entities, and so on. Distances of entities directly connected by a path are positive integers no larger than 200. Entities not directly connected by a path have a distance of 0. The distance from an entity to itself (i.e., all numbers on the diagonal) is also given as 0. To keep the input lines of reasonable length, when K+C > 15, a row is broken into successive lines of 15 numbers and a potentially shorter line to finish up a row. Each new row begins on its own line. Output A single line with a single integer that is the minimum possible total distance for the furthest walking cow. Sample Input 2 3 2 0 3 2 1 1 3 0 3 2 0 2 3 0 1 0 1 2 1 0 2 1 0 0 2 0 Sample Output 2
C语言 这道题怎解 似乎并不难_course
20151129Description Lasercat numbers are defined recursively as follows. (1) numbers 1 and 2 are Lasercat numbers; (2) if a and b are Lasercat numbers, so is (a+b)^21; (3) only the numbers defined in (1) and (2) are Lasercat numbers. Now your task is to judge whether an integer is a Lasercat number. Input There are several lines in input. The first line of the input is the number of the cases, the next each line has a nonnegative integer a, 0<=a<=1000000000. Output For the number a on each line of the input, if a is a Lasercat number, output “YES!”, otherwise output “NO!”. Sample Input 2 3 14 Sample Output YES! NO!
Incredible! Impossible! _course
20171011Description "Give me the sums of each column and of each row of the rectangular table n*m",  Alex said,  "and I will tell you whether such a table exists, and if exists for a small fee I can create an example of such table". "Incredible! Impossible!",  say all his classmates,  "So many numbers! You must be a true genius!". But Basil does not like that Alex becomes the most known person at the school.  "I say! I am Basil the greatest! Given a rectangular table n*m and the sums of rows and columns I will tell you a number of possible tables with nonnegative integers satisfying these conditions".  "You boast! I bet five dollars you can't do it even for n*3",  Alex says.  "I bet five that I can!",  says Basil. Tomorrow is the contest. Alex will create some tables with size n*3, and tell Basil the sums and the dimensions. All boys and girls do the stakes who will be the winner! You are the friend of Alex. He wants to create some hard data sets for Basil, and he needs to have a method to calculate the answer. Because Alex can't solve such kind of tasks, he asked you to write a program that will do it for him. Alex needs only last seventeen digits to check the answers. So you must calculate the number of possible tables taken modulo 1017 . Input The first line contains four numbers: n, c1 , c2 , c3 , where n is the number of rows, ci are the sums of columns. n numbers follow, each is the sum of the corresponding row. n and all sums are nonnegative integers. They are not greater than 125. Output On the first line output the number of possible tables taken modulo 1017 . Sample Input 3 1 2 3 2 3 4 Sample Output 0
Polypolygonal Numbers _course
20171010Description A polygonal number is a number which can be represented by a regular geometrical arrangement of equally spaced points, where the arrangement forms a regular polygon. Some examples are shown in the figure below. ![](http://poj.org/images/1640_1.jpg) The first figure shows the first 4 triangular numbers 1, 3, 6, 10. The next three show the first four square, pentagonal and hexagonal numbers, respectively. In general, kgonal numbers are those whose points define a regular kgon (hence triangular numbers are 3gonal, square numbers are 4gonal, etc.).We will define k as an index of the polygonal number. For this problem, you are to find numbers which are kgonal for two or more values of k. We will call these numbers polypolygonal. Input Input will consist of multiple problem instances. Each instance will consist of 3 lines. The first line will be a nonnegative integer n <= 50 indicating the number of types of polygonal numbers of interest in this problem. Note that this line may be longer than 80 characters. The next line will contain n integers indicating the indices of these polygonal numbers (all distinct and in increasing order). For example, if the first line contained the value 3, and the next line contained the values 3 6 10, then that problem instance would be interested in 3gonal, 6gonal and 10gonal numbers. Each index k will lie in the range 3 <= k <= 1000. The last line of the problem instance will consist of a single positive integer s <= 10000, which serves as a starting point for the search for polypolygonal numbers. A value of n = 0 terminates the input. Output For each problem instance, you should output the next 5 polypolygonal numbers which are greater than or equal to s. Each number should be on a single line and conform to the following format: num:k1 k2 k3 ... where num is the polypolygonal number, and k1, k2, k3 ... are the indices (in increasing order) of the polypolygonal number equal to num. A single space should separate each index, and you should separate each problem instance with a single blank line. The judges input will be such that the maximum value for any polypolygonal number will fit in a long variable. Sample Input 10 6 7 8 9 10 11 12 13 14 15 1000 5 3 4 13 36 124 1 0 Sample Output 1216:9 12 1540:6 10 1701:10 13 2300:11 14 3025:12 15 1:3 4 13 36 124 36:3 4 13 36 105:3 36 171:3 13 1225:3 4 124
Goldbach's Conjecture _course
20161226Description For any even number n greater than or equal to 4, there exists at least one pair of prime numbers p1 and p2 such that n = p1 + p2 This conjecture has not been proved nor refused yet. No one is sure whether this conjecture actually holds. However, one can find such a pair of prime numbers, if any, for a given even number. The problem here is to write a program that reports the number of all the pairs of prime numbers satisfying the condition in the conjecture for a given even number. A sequence of even numbers is given as input. There can be many such numbers. Corresponding to each number, the program should output the number of pairs mentioned above. Notice that we are interested in the number of essentially different pairs and therefore you should not count (p1, p2) and (p2, p1) separately as two different pairs. Input An integer is given in each input line. You may assume that each integer is even, and is greater than or equal to 4 and less than 215. The end of the input is indicated by a number 0. Output Each output line should contain an integer number. No other characters should appear in the output. Sample Input 6 10 12 0 Sample Output 1 2 1
Hexagon _course
20170308Consider a game board consisting of 19 hexagonal fields, as shown in the figure below. We can easily distinguish three main directions in the shape of the board: from top to bottom, from topleft to bottomright, and from topright to bottomleft. For each of these primary directions, the board can be viewed as a series of rows, consisting of 3, 4, 5, 4, and 3 fields, respectively. The game board has to be completely covered using a set of hexagonal pieces. Each piece carries three numbers, one for every primary board direction. Only three different numbers are used for each direction. Every possible combination of three numbers for all three directions is assigned to a piece, leading to a set of 27 unique pieces. (The board in the above figure is still in the process of being covered.) The score of a board is calculated as the sum of all 15 row scores (5 rows for each primary direction). The row scores are calculated as follows: if all pieces in a row carry the same number for the direction of the row, the row score is this number multiplied by the number of pieces in the row. Otherwise (the pieces carry different numbers in the row direction) the row score is zero. Note that the pieces may not be rotated. For example, the score of the leftmost row in the figure is 3 x 3 = 9, the score of the row to its right is 4 x 11 = 44. While in the real game the pieces are chosen randomly and the set of pieces is fixed, we are interested in the highest possible score for a given set of numbers for each direction, when all pieces in a row carry the same number for the direction of the row. This means you have to choose those 19 pieces that result in the highest score. Input The first line of the input contains an integer n which indicates the number of test cases. Each test case consists of three lines containing three integers each. Each of these three line contains the numbers for a single primary direction. From these numbers the set of pieces is generated. Output For each test case output a line containing the number of the case (`Test #1', `Test #2', etc.), followed by a line containing the highest possible score for the given numbers. Add a blank line after each test case. Sample Input 1 9 4 3 8 5 2 7 6 1 Sample Output Test #1 308
Currency Exchange _course
20161116Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with these currencies. There can be several points specializing in the same pair of currencies. Each point has its own exchange rates, exchange rate of A to B is the quantity of B you get for 1A. Also each exchange point has some commission, the sum you have to pay for your exchange operation. Commission is always collected in source currency. For example, if you want to exchange 100 US Dollars into Russian Rubles at the exchange point, where the exchange rate is 29.75, and the commission is 0.39 you will get (100  0.39) * 29.75 = 2963.3975RUR. You surely know that there are N different currencies you can deal with in our city. Let us assign unique integer number from 1 to N to each currency. Then each exchange point can be described with 6 numbers: integer A and B  numbers of currencies it exchanges, and real RAB, CAB, RBA and CBA  exchange rates and commissions when exchanging A to B and B to A respectively. Nick has some money in currency S and wonders if he can somehow, after some exchange operations, increase his capital. Of course, he wants to have his money in currency S in the end. Help him to answer this difficult question. Nick must always have nonnegative sum of money while making his operations. Input The first line of the input contains four numbers: N  the number of currencies, M  the number of exchange points, S  the number of currency Nick has and V  the quantity of currency units he has. The following M lines contain 6 numbers each  the description of the corresponding exchange point  in specified above order. Numbers are separated by one or more spaces. 1<=S<=N<=100, 1<=M<=100, V is real number, 0<=V<=103. For each point exchange rates and commissions are real, given with at most two digits after the decimal point, 102<=rate<=102, 0<=commission<=102. Let us call some sequence of the exchange operations simple if no exchange point is used more than once in this sequence. You may assume that ratio of the numeric values of the sums at the end and at the beginning of any simple sequence of the exchange operations will be less than 104. Output If Nick can increase his wealth, output YES, in other case output NO to the output file. Sample Input 3 2 1 20.0 1 2 1.00 1.00 1.00 1.00 2 3 1.10 1.00 1.10 1.00 Sample Output YES
Uniform Generator _course
20170611Problem Description Computer simulations often require random numbers. One way to generate pseudorandom numbers is via a function of the form seed(x+1) = [seed(x) + STEP] % MOD where '%' is the modulus operator. Such a function will generate pseudorandom numbers (seed) between 0 and MOD1. One problem with functions of this form is that they will always generate the same pattern over and over. In order to minimize this effect, selecting the STEP and MOD values carefully can result in a uniform distribution of all values between (and including) 0 and MOD1. For example, if STEP = 3 and MOD = 5, the function will generate the series of pseudorandom numbers 0, 3, 1, 4, 2 in a repeating cycle. In this example, all of the numbers between and including 0 and MOD1 will be generated every MOD iterations of the function. Note that by the nature of the function to generate the same seed(x+1) every time seed(x) occurs means that if a function will generate all the numbers between 0 and MOD1, it will generate pseudorandom numbers uniformly with every MOD iterations. If STEP = 15 and MOD = 20, the function generates the series 0, 15, 10, 5 (or any other repeating series if the initial seed is other than 0). This is a poor selection of STEP and MOD because no initial seed will generate all of the numbers from 0 and MOD1. Your program will determine if choices of STEP and MOD will generate a uniform distribution of pseudorandom numbers. Input Each line of input will contain a pair of integers for STEP and MOD in that order (1 <= STEP, MOD <= 100000). Output For each line of input, your program should print the STEP value right justified in columns 1 through 10, the MOD value rightjustified in columns 11 through 20 and either "Good Choice" or "Bad Choice" leftjustified starting in column 25. The "Good Choice" message should be printed when the selection of STEP and MOD will generate all the numbers between and including 0 and MOD1 when MOD numbers are generated. Otherwise, your program should print the message "Bad Choice". After each output test set, your program should print exactly one blank line. Sample Input 3 5 15 20 63923 99999 Sample Output 3 5 Good Choice 15 20 Bad Choice 63923 99999 Good Choice
学透JavaScript
20200314JavaScript是前端程序员的必修课，也是目前流行的各前端框架的基础知识。本课程将全面剖析JavaScript的运行机制，掌握最核心的语法和编程思维、使用丰富的实例来帮助学员的理解JavaScript、jQurey。介绍笔试，面试环节中关于JS的常见问题，为将来的工作打下坚实基础。主讲老师有着丰富的前端开发经验和教学经验，在教学过程中不仅注重前端实践的动手能力，同时也注重培养同学们的编程思维模式和手写代码的核心能力。全课程不复制粘贴，除了特殊情况外，所有代码全部直播手写（直接敲代码），增加同学们的印象，相信通过这样的能力训练，同学们的动手能力会有飞越的提升。
高性能MySQL实战课
20200521限时福利1：原价 129 元，最后2天仅需 69 元！后天涨价至98元 限时福利2：购课进答疑群专享柳峰（刘运强）老师答疑服务 限时福利3：购课添加助教领取价值 800 元的编程大礼包 为什么需要掌握高性能的MySQL实战？ 由于互联网产品用户量大、高并发请求场景多，因此对MySQL的性能、可用性、扩展性都提出了很高的要求。使用MySQL解决大量数据以及高并发请求已经是程序员的必备技能，也是衡量一个程序员能力和薪资的标准之一。 为了让大家快速系统了解高性能MySQL核心知识全貌，我为你总结了「高性能 MySQL 知识框架图」,帮你梳理学习重点，建议收藏！ 【课程设计】 课程分为四大篇章，将为你建立完整的 MySQL 知识体系，同时将重点讲解 MySQL 底层运行原理、数据库的性能调优、高并发、海量业务处理、面试解析等。 一、性能优化篇： 主要包括经典 MySQL 问题剖析、索引底层原理和事务与锁机制。通过深入理解 MySQL 的索引结构 B+Tree ，学员能够从根本上弄懂为什么有些 SQL 走索引、有些不走索引，从而彻底掌握索引的使用和优化技巧，能够避开很多实战中遇到的“坑”。 二、MySQL 8.0新特性篇： 主要包括窗口函数和通用表表达式。企业中的许多报表统计需求，如果不采用窗口函数，用普通的 SQL 语句是很难实现的。 三、高性能架构篇： 主要包括主从复制和读写分离。在企业的生产环境中，很少采用单台MySQL节点的情况，因为一旦单个节点发生故障，整个系统都不可用，后果往往不堪设想，因此掌握高可用架构的实现是非常有必要的。 四、面试篇： 程序员获得工作的第一步，就是高效的准备面试，面试篇主要从知识点回顾总结的角度出发，结合程序员面试高频MySQL问题精讲精练，帮助程序员吊打面试官，获得心仪的工作机会。
 3.64MB
Xshell6完美破解版，亲测可用
20181226Xshell6破解版，亲测可用，分享给大家。直接解压即可使用
 下载 apachemaven3.6.1bin.zip
 下载 显示/光电技术中的数字电源技术推动LED照明发展
 博客 内容管理（八）02删除响应无内容处理 JSONBIG.parse(null) 报错代码最好使用try{}catch(){}，弹出框确认消息组件使用
 博客 AndroidStudio 调试桥(adb)、Shell、logcat的使用
 博客 凭借这份Java超硬核面试 “备战” 手册！我刚面试完字节跳动、阿里、华为、小米等后端岗位
 博客 可视化实验图库
 学院 UI自动化测试全家桶
 下载 JSP实现的简单分页示例
 学院 python基础快速处理Excel
 博客 LAMP搭建博客网站（腾讯云UbuntuCVM、MySQL数据库、域名注册）（WordPress）
 学院 Spring AOP从认识到源码
 下载 jwtdecode.js
 博客 vs编译lib重复包含错误，提示error LNK2005:解决方案
 学院 人工智能特训营第32期
 下载 单片机与DSP中的射频卡多协议读写器的设计和实现
 学院 2020千锋Python入门视频全套全开源（最新版）
 博客 Java集合类HashTable与HashMap的区别——源码分析
 博客 个人独资企业可否成为多人有限公司的一个股东？
 博客 程序人生  如何不喝到奶茶里面珍珠的方法？
 学院 SkyEye智慧眼系统搭建 一
 学院 Axure 9.0 因缺思厅案例教程
 下载 spotlight安装文件+instantclient_11.2_x32依赖包
 下载 php二维码生成
 下载 基于PowerPC的车辆显控系统
 学院 FFmpeg4.3开发系列之七：WEB音视频转码器Java版
 博客 PYTHON_数据拼接
 博客 Ubutu离线安装pip
 学院 基于海思3536平台为示例的嵌入式软件开发基础篇
 学院 JVM从入门到入魔
 下载 通信与网络中的基于ZigBee技术的温室监控系统网关设计方案