pascal 计算几何 求大神解答 就是清帝之惑之雍正那个 谢谢

雍正将大致的情况告诉了你，并且说：大清一共有n个大城市，所有的大城市都不在同一个地点，同时我们对这n个城市从1到n进行编号；对于一个城市k，他有两个属性，一个是Xk，一个是Yk，分别表示这个城市所处的经度和纬度。请你告诉他问题的结果：L，即运河长度。（你可以假定地球是平面的）

从第2行到n+1行，按照i从小到大顺序，每行两个整数Xi，Yi，代表编号为i的城市的经度和纬度。
其中2<=n <=100000，1<=Xi,Yi<2^31。

2个回答

http://blog.sina.cn/dpool/blog/s/blog_6678bed30100hqvp.html?vt=4

http://blog.sina.com.cn/s/blog_6243d9940100f5sy.h

## 最后小小的问一句，这题怎么这么浓厚的历史氛围呢。。。。

pascal 计算几何 求大神赐教 谢谢！！

pascal 问题 计算式子的值 求大神指点

Description Pascal requires that real constants have either a decimal point, or an exponent (starting with the letter e or E, and officially called a scale factor), or both, in addition to the usual collection of decimal digits. If a decimal point is included it must have at least one decimal digit on each side of it. As expected, a sign (+ or -) may precede the entire number, or the exponent, or both. Exponents may not include fractional digits. Blanks may precede or follow the real constant, but they may not be embedded within it. Note that the Pascal syntax rules for real constants make no assumptions about the range of real values, and neither does this problem. Your task in this problem is to identify legal Pascal real constants. Input Each line of the input data contains a candidate which you are to classify. Output For each line of the input, display your finding as illustrated in the example shown below. The input terminates with a line that contains only an asterisk in column one. Sample Input 1.2 1. 1.0e-55 e-12 6.5E 1e-12 +4.1234567890E-99999 7.6e+12.5 99 * Sample Output 1.2 is legal. 1. is illegal. 1.0e-55 is legal. e-12 is illegal. 6.5E is illegal. 1e-12 is legal. +4.1234567890E-99999 is legal. 7.6e+12.5 is illegal. 99 is illegal.

Do the Untwist 具体怎么来写的
Description Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the ciphertext will be able to figure out the plaintext except the intended recipient. Transforming the plaintext to the ciphertext is encryption; transforming the ciphertext to the plaintext is decryption. Twisting is a simple encryption method that requires that the sender and recipient both agree on a secret key k, which is a positive integer. The twisting method uses four arrays: plaintext and ciphertext are arrays of characters, and plaincode and ciphercode are arrays of integers. All arrays are of length n, where n is the length of the message to be encrypted. Arrays are origin zero, so the elements are numbered from 0 to n - 1. For this problem all messages will contain only lowercase letters, the period, and the underscore (representing a space). The message to be encrypted is stored in plaintext. Given a key k, the encryption method works as follows. First convert the letters in plaintext to integer codes in plaincode according to the following rule: '_' = 0, 'a' = 1, 'b' = 2, ..., 'z' = 26, and '.' = 27. Next, convert each code in plaincode to an encrypted code in ciphercode according to the following formula: for all i from 0 to n - 1, ciphercode[i] = (plaincode[ki mod n] - i) mod 28. (Here x mod y is the positive remainder when x is divided by y. For example, 3 mod 7 = 3, 22 mod 8 = 6, and -1 mod 28 = 27. You can use the C '%' operator or Pascal 'mod' operator to compute this as long as you add y if the result is negative.) Finally, convert the codes in ciphercode back to letters in ciphertext according to the rule listed above. The final twisted message is in ciphertext. Twisting the message cat using the key 5 yields the following: Array 0 1 2 plaintext 'c' 'a' 't' plaincode 3 1 20 ciphercode 3 19 27 ciphertext 'c' 's' '.' Your task is to write a program that can untwist messages, i.e., convert the ciphertext back to the original plaintext given the key k. For example, given the key 5 and ciphertext 'cs.', your program must output the plaintext 'cat'. Input The input contains one or more test cases, followed by a line containing only the number 0 that signals the end of the file. Each test case is on a line by itself and consists of the key k, a space, and then a twisted message containing at least one and at most 70 characters. The key k will be a positive integer not greater than 300. Output For each test case, output the untwisted message on a line by itself. Note: you can assume that untwisting a message always yields a unique result. (For those of you with some knowledge of basic number theory or abstract algebra, this will be the case provided that the greatest common divisor of the key k and length n is 1, which it will be for all test cases.) Sample Input 5 cs. 101 thqqxw.lui.qswer 3 b_ylxmhzjsys.virpbkr 0 Sample Output cat this_is_a_secret beware._dogs_barking
Pascal菜鸟求帮助！！

Tensorflow object detection api 训练自己数据 map一直是 -1

Combinations 组合的问题
Description Computing the exact number of ways that N things can be taken M at a time can be a great challenge when N and/or M become very large. Challenges are the stuff of contests. Therefore, you are to make just such a computation given the following: GIVEN: 5 <= N <= 100; 5 <= M <= 100; M <= N Compute the EXACT value of: C = N! / (N-M)!M! You may assume that the final value of C will fit in a 32-bit Pascal LongInt or a C long. For the record, the exact value of 100! is: 93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621, 468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253, 697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000 Input The input to this program will be one or more lines each containing zero or more leading spaces, a value for N, one or more spaces, and a value for M. The last line of the input file will contain a dummy N, M pair with both values equal to zero. Your program should terminate when this line is read. Output The output from this program should be in the form: N things taken M at a time is C exactly. Sample Input 100 6 20 5 18 6 0 0 Sample Output 100 things taken 6 at a time is 1192052400 exactly. 20 things taken 5 at a time is 15504 exactly. 18 things taken 6 at a time is 18564 exactly.

Problem Description Anna Graham is a puzzle maker who prides herself in the quality and complexity of her work. She makes puzzles of all kinds - crosswords, logic problems, acrostics, and word search puzzles, to name but a few. For each puzzle, she has developed a set of rules which she constrains herself to follow. For word search puzzles, she insists not only that all the words be connected to one another (as in most word search puzzles), but also that removing any word from the word list will not cause one or more words to become disconnected from the rest. (Two words are connected if they contain a common letter in the grid.) The example word search puzzle on the left satisfies this condition, but the one on the right does not (removing the word Pascal from the word list disconnects Java from the other two words). Your job is to write a program that checks to see if Anna’s word search problems are up to snuff. Input Input will consist of multiple test cases. The first line of each test case contains 3 integers n m l, where n and m are the number of rows and columns in the puzzle and l is the number of words. Following this are n lines containing m uppercase characters each (the puzzle) followed by l lines containing one word each (the word list, in mixed case). Each word in the word list will appear in the puzzle exactly once. There will be no more than 100 rows and 100 columns in the puzzle and no more than 100 words to search for. There will be no spaces in the input words. Output For each problem instance, output the word Yes or No depending on whether the puzzle satisfies Anna’s constraints. Sample Input 5 6 3 PBROGR PASCAL ASMMIN GIICON TCELST BASIC LISP Pascal 5 6 4 PBROJR PASCAL ASMMVN GIICAN TCELST BASIC Java LISP Pascal 0 0 0 Sample Output Yes No
Combinations 具体的做法是什么
Description Computing the exact number of ways that N things can be taken M at a time can be a great challenge when N and/or M become very large. Challenges are the stuff of contests. Therefore, you are to make just such a computation given the following: GIVEN: 5 <= N <= 100; 5 <= M <= 100; M <= N Compute the EXACT value of: C = N! / (N-M)!M! You may assume that the final value of C will fit in a 32-bit Pascal LongInt or a C long. For the record, the exact value of 100! is: 93,326,215,443,944,152,681,699,238,856,266,700,490,715,968,264,381,621, 468,592,963,895,217,599,993,229,915,608,941,463,976,156,518,286,253, 697,920,827,223,758,251,185,210,916,864,000,000,000,000,000,000,000,000 Input The input to this program will be one or more lines each containing zero or more leading spaces, a value for N, one or more spaces, and a value for M. The last line of the input file will contain a dummy N, M pair with both values equal to zero. Your program should terminate when this line is read. Output The output from this program should be in the form: N things taken M at a time is C exactly. Sample Input 100 6 20 5 18 6 0 0 Sample Output 100 things taken 6 at a time is 1192052400 exactly. 20 things taken 5 at a time is 15504 exactly. 18 things taken 6 at a time is 18564 exactly.
Pascal Library
Description Pascal University, one of the oldest in the country, needs to renovate its Library Building, because after all these centuries the building started to show the effects of supporting the weight of the enormous amount of books it houses. To help in the renovation, the Alumni Association of the University decided to organize a series of fund-raising dinners, for which all alumni were invited. These events proved to be a huge success and several were organized during the past year. (One of the reasons for the success of this initiative seems to be the fact that students that went through the Pascal system of education have fond memories of that time and would love to see a renovated Pascal Library.) The organizers maintained a spreadsheet indicating which alumni participated in each dinner. Now they want your help to determine whether any alumnus or alumna took part in all of the dinners. Input The input contains several test cases. The first line of a test case contains two integers N and D indicating respectively the number of alumni and the number of dinners organized (1 <= N <= 100 and 1 <= D <= 500). Alumni are identified by integers from 1 to N. Each of the next D lines describes the attendees of a dinner, and contains N integers Xi indicating if the alumnus/alumna i attended that dinner (Xi = 1) or not (Xi = 0). The end of input is indicated by N = D = 0. Output For each test case in the input your program must produce one line of output, containing either the word yes', in case there exists at least one alumnus/alumna that attended all dinners, or the word no' otherwise. Sample Input 3 3 1 1 1 0 1 1 1 1 1 7 2 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 Sample Output yes no
Identifying Legal Pascal Real Constants
Description Pascal requires that real constants have either a decimal point, or an exponent (starting with the letter e or E, and officially called a scale factor), or both, in addition to the usual collection of decimal digits. If a decimal point is included it must have at least one decimal digit on each side of it. As expected, a sign (+ or -) may precede the entire number, or the exponent, or both. Exponents may not include fractional digits. Blanks may precede or follow the real constant, but they may not be embedded within it. Note that the Pascal syntax rules for real constants make no assumptions about the range of real values, and neither does this problem. Your task in this problem is to identify legal Pascal real constants. Input Each line of the input data contains a candidate which you are to classify. Output For each line of the input, display your finding as illustrated in the example shown below. The input terminates with a line that contains only an asterisk in column one. Sample Input 1.2 1. 1.0e-55 e-12 6.5E 1e-12 +4.1234567890E-99999 7.6e+12.5 99 * Sample Output 1.2 is legal. 1. is illegal. 1.0e-55 is legal. e-12 is illegal. 6.5E is illegal. 1e-12 is legal. +4.1234567890E-99999 is legal. 7.6e+12.5 is illegal. 99 is illegal.
Do the Untwist 正确实现的思路
Description Cryptography deals with methods of secret communication that transform a message (the plaintext) into a disguised form (the ciphertext) so that no one seeing the ciphertext will be able to figure out the plaintext except the intended recipient. Transforming the plaintext to the ciphertext is encryption; transforming the ciphertext to the plaintext is decryption. Twisting is a simple encryption method that requires that the sender and recipient both agree on a secret key k, which is a positive integer. The twisting method uses four arrays: plaintext and ciphertext are arrays of characters, and plaincode and ciphercode are arrays of integers. All arrays are of length n, where n is the length of the message to be encrypted. Arrays are origin zero, so the elements are numbered from 0 to n - 1. For this problem all messages will contain only lowercase letters, the period, and the underscore (representing a space). The message to be encrypted is stored in plaintext. Given a key k, the encryption method works as follows. First convert the letters in plaintext to integer codes in plaincode according to the following rule: '_' = 0, 'a' = 1, 'b' = 2, ..., 'z' = 26, and '.' = 27. Next, convert each code in plaincode to an encrypted code in ciphercode according to the following formula: for all i from 0 to n - 1, ciphercode[i] = (plaincode[ki mod n] - i) mod 28. (Here x mod y is the positive remainder when x is divided by y. For example, 3 mod 7 = 3, 22 mod 8 = 6, and -1 mod 28 = 27. You can use the C '%' operator or Pascal 'mod' operator to compute this as long as you add y if the result is negative.) Finally, convert the codes in ciphercode back to letters in ciphertext according to the rule listed above. The final twisted message is in ciphertext. Twisting the message cat using the key 5 yields the following: Array 0 1 2 plaintext 'c' 'a' 't' plaincode 3 1 20 ciphercode 3 19 27 ciphertext 'c' 's' '.' Your task is to write a program that can untwist messages, i.e., convert the ciphertext back to the original plaintext given the key k. For example, given the key 5 and ciphertext 'cs.', your program must output the plaintext 'cat'. Input The input contains one or more test cases, followed by a line containing only the number 0 that signals the end of the file. Each test case is on a line by itself and consists of the key k, a space, and then a twisted message containing at least one and at most 70 characters. The key k will be a positive integer not greater than 300. Output For each test case, output the untwisted message on a line by itself. Note: you can assume that untwisting a message always yields a unique result. (For those of you with some knowledge of basic number theory or abstract algebra, this will be the case provided that the greatest common divisor of the key k and length n is 1, which it will be for all test cases.) Sample Input 5 cs. 101 thqqxw.lui.qswer 3 b_ylxmhzjsys.virpbkr 0 Sample Output cat this_is_a_secret beware._dogs_barking
Binary Search 的程序的实现
Description The program fragment below performs binary search of an integer number in an array that is sorted in a nondescending order: Pascal (file "sproc.pas") const MAXN = 10000; var A: array[0..MAXN-1] of integer; N: integer; procedure BinarySearch(x: integer); var p, q, i, L: integer; begin p := 0; { Left border of the search } q := N-1; { Right border of the search } L := 0; { Comparison counter } while p <= q do begin i := (p + q) div 2; inc(L); if A[i] = x then begin writeln('Found item i = ', i, ' in L = ', L, ' comparisons'); exit end; if x < A[i] then q := i - 1 else p := i + 1 end end; C (file "sproc.c") #define MAXN 10000 int A[MAXN]; int N; void BinarySearch(int x) { int p, q, i, L; p = 0; /* Left border of the search */ q = N-1; /* Right border of the search */ L = 0; /* Comparison counter */ while (p <= q) { i = (p + q) / 2; ++L; if (A[i] == x) { printf("Found item i = %d" " in L = %d comparisons\n", i, L); return; } if (x < A[i]) q = i - 1; else p = i + 1; } } Before BinarySearch was called, N was set to some integer number from 1 to 10000 inclusive and array A was filled with a nondescending integer sequence. It is known that the procedure has terminated with the message "Found item i = XXX in L = XXX comparisons" with some known values of i and L. Your task is to write a program that finds all possible values of N that could lead to such message. However, the number of possible values of N can be quite big. Thus, you are asked to group all consecutive Ns into intervals and write down only first and last value in each interval. Input The input file consists of a single line with two integers i and L (0 <= i < 10000 and 1 <= L <= 14), separated by a space. Output On the first line of the output file write the single integer number K representing the total number of intervals for possible values of N. Then K lines shall follow listing those intervals in an ascending order. Each line shall contain two integers Ai and Bi (Ai <= Bi) separated by a space, representing first and last value of the interval. If there are no possible values of N exist, then the output file shall contain the single 0. Sample Input 10 3 Sample Output 4 12 12 17 18 29 30 87 94

（接上文《源码阅读(18)：Java中主要的Map结构——HashMap容器（中）》） 3.4.4、HashMap添加K-V键值对（红黑树方式） 上文我们介绍了在HashMap中table数组的某个索引位上，基于单向链表添加新的K-V键值对对象（HashMap.Node&lt;K, V&gt;类的实例），但是我们同时知道在某些的场景下，HashMap中table数据的某个索引位上，数据是按照红黑树
c++制作的植物大战僵尸，开源，一代二代结合游戏
此游戏全部由本人自己制作完成。游戏大部分的素材来源于原版游戏素材，少部分搜集于网络，以及自己制作。 此游戏为同人游戏而且仅供学习交流使用，任何人未经授权，不得对本游戏进行更改、盗用等，否则后果自负。 目前有六种僵尸和六种植物，植物和僵尸的动画都是本人做的。qq：2117610943 开源代码下载 提取码：3vzm 点击下载--&gt; 11月28日 新增四种植物 统一植物画风，全部修
Java学习的正确打开方式

Python——画一棵漂亮的樱花树（不同种樱花+玫瑰+圣诞树喔）

linux系列之常用运维命令整理笔录

Python 基础（一）：入门必备知识

Python十大装B语法
Python 是一种代表简单思想的语言，其语法相对简单，很容易上手。不过，如果就此小视 Python 语法的精妙和深邃，那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点，并附上详细的实例代码。如能在实战中融会贯通、灵活使用，必将使代码更为精炼、高效，同时也会极大提升代码B格，使之看上去更老练，读起来更优雅。 1. for - else 什么？不是 if 和 else 才

2019年11月中国大陆编程语言排行榜
2019年11月2日，我统计了某招聘网站，获得有效程序员招聘数据9万条。针对招聘信息，提取编程语言关键字，并统计如下： 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7

Python 编程实用技巧
Python是一门很灵活的语言，也有很多实用的方法，有时候实现一个功能可以用多种方法实现，我这里总结了一些常用的方法，并会持续更新。
“狗屁不通文章生成器”登顶GitHub热榜，分分钟写出万字形式主义大作

"狗屁不通文章生成器"登顶GitHub热榜，分分钟写出万字形式主义大作
GitHub 被誉为全球最大的同性交友网站，……，陪伴我们已经走过 10+ 年时间，它托管了大量的软件代码，同时也承载了程序员无尽的欢乐。 万字申请，废话报告，魔幻形式主义大作怎么写？兄dei，狗屁不通文章生成器了解一下。这个富有灵魂的项目名吸引了众人的目光。项目仅仅诞生一周，便冲上了GitHub趋势榜榜首（Js中文网 -前端进阶资源教程）、是榜首哦