上一页 1 ··· 74 75 76 77 78 79 80 81 82 ··· 89 下一页
摘要: This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case. Each case occupies 2 lines, a 阅读全文
posted @ 2018-07-29 12:03 王清河 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less t 阅读全文
posted @ 2018-07-29 10:49 王清河 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given "Is PAT&TAP symmetric?", the longest sym 阅读全文
posted @ 2018-07-28 20:59 王清河 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which cou 阅读全文
posted @ 2018-07-28 20:47 王清河 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off th 阅读全文
posted @ 2018-07-25 11:03 王清河 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 一个数组A中存有N(N&gt0)个整数,在不允许使用另外数组的前提下,将每个整数循环向右移M(M>=0)个位置,即将A中的数据由(A~0~ A~1~……A~N-1~)变换为(A~N-M~ …… A~N-1~ A~0~ A~1~……A~N-M-1~)(最后M个数循环移至最前面的M个位置)。如果需要考虑 阅读全文
posted @ 2018-07-24 16:05 王清河 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 让我们定义 dn 为:dn = pn+1 - pn,其中 pi 是第i个素数。显然有 d1=1 且对于n>1有 dn 是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。 现给定任意正整数N (< 105),请计算不超过N的满足猜想的素数对的个数。 输入格式:每个测试输入包含1个测试用例, 阅读全文
posted @ 2018-07-24 16:03 王清河 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。 当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对n=3进行验证的时候,我们需要计算3、5、8、4、2、1,则当我们对n=5、8、4、2进行验证的时候,就可以直接判定卡拉兹 阅读全文
posted @ 2018-07-24 16:00 王清河 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 卡拉兹(Callatz)猜想: 对任何一个自然数n,如果它是偶数,那么把它砍掉一半;如果它是奇数,那么把(3n+1)砍掉一半。这样一直反复砍下去,最后一定在某一步得到n=1。卡拉兹在1950年的世界数学家大会上公布了这个猜想,传说当时耶鲁大学师生齐动员,拼命想证明这个貌似很傻很天真的命题,结果闹得学 阅读全文
posted @ 2018-07-24 15:57 王清河 阅读(99) 评论(0) 推荐(0) 编辑
摘要: “答案正确”是自动判题系统给出的最令人欢喜的回复。本题属于PAT的“答案正确”大派送 —— 只要读入的字符串满足下列条件,系统就输出“答案正确”,否则输出“答案错误”。 得到“答案正确”的条件是: 1. 字符串中必须仅有P, A, T这三种字符,不可以包含其它字符;\ 现在就请你为PAT写一个自动裁 阅读全文
posted @ 2018-07-24 15:52 王清河 阅读(103) 评论(0) 推荐(0) 编辑
上一页 1 ··· 74 75 76 77 78 79 80 81 82 ··· 89 下一页