摘要: Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of relations: synonymy (i. e. the two wo 阅读全文
posted @ 2018-08-16 22:13 岩扉 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一个多项式 (by+ax)^k(by+ax)k ,请求出多项式展开后 x^n \times y^mxn×ym 项的系数。 输入输出格式 输入格式: 共一行,包含 55 个整数,分别为 a ,b ,k ,n ,ma,b,k,n,m ,每两个整数之间用一个空格隔开。 输出格式: 共1 行, 阅读全文
posted @ 2018-08-15 21:21 岩扉 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 详解 该函数的主要作用是计算一个数字的二进制中有多少个1,返回值就是其中1的个数。 它使用一张基于表的方法来进行位搜索,因此这个操作的执行效率很高 此处举一题 P1582 倒水 阅读全文
posted @ 2018-08-15 19:04 岩扉 阅读(3303) 评论(0) 推荐(1) 编辑
摘要: Problem Description Mr.Quin love fishes so much and Mr.Quin’s city has a nautical system,consisiting of N ports and M shipping lines. The ports are nu 阅读全文
posted @ 2018-08-15 16:49 岩扉 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 描述 自己使用时发现点了结束按钮后,打开任务管理器,发现刚才运行的程序还在,并没有被杀死。 有时如果一个程序写了死循环,就会出现疯狂占用内存,最后不得不关机重启。 解决方案 这是他的社区有人也有这样的问题。 https://intellij-support.jetbrains.com/hc/en-u 阅读全文
posted @ 2018-08-15 16:34 岩扉 阅读(1054) 评论(1) 推荐(0) 编辑
摘要: The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus 阅读全文
posted @ 2018-08-15 10:27 岩扉 阅读(1074) 评论(0) 推荐(0) 编辑
摘要: 题目描述 作为体育委员,C君负责这次运动会仪仗队的训练。仪仗队是由学生组成的N * N的方阵,为了保证队伍在行进中整齐划一,C君会跟在仪仗队的左后方,根据其视线所及的学生人数来判断队伍是否整齐(如下图)。 现在,C君希望你告诉他队伍整齐时能看到的学生人数。 输入输出格式 输入格式: 共一个数N 输出 阅读全文
posted @ 2018-08-14 15:54 岩扉 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 题目描述 科学家们在Samuel星球上的探险得到了丰富的能源储备,这使得空间站中大型计算机“Samuel II”的长时间运算成为了可能。由于在去年一年的辛苦工作取得了不错的成绩,小联被允许用“Samuel II”进行数学研究。 小联最近在研究和约数有关的问题,他统计每个正数N的约数的个数,并以f(N 阅读全文
posted @ 2018-08-13 16:52 岩扉 阅读(233) 评论(0) 推荐(0) 编辑
摘要: Description Our Black Box represents a primitive database. It can save an integer array and has a special i variable. At the initial moment Black Box 阅读全文
posted @ 2018-08-13 16:17 岩扉 阅读(321) 评论(0) 推荐(0) 编辑
摘要: You are given two positive integer numbers a and b. Permute (change order) of the digits of a to construct maximal number not exceeding b. No number i 阅读全文
posted @ 2018-08-11 19:14 岩扉 阅读(333) 评论(0) 推荐(0) 编辑
摘要: Description The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and G 阅读全文
posted @ 2018-08-10 18:36 岩扉 阅读(196) 评论(0) 推荐(0) 编辑
摘要: Description Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance. It orders two a 阅读全文
posted @ 2018-08-10 14:21 岩扉 阅读(390) 评论(0) 推荐(0) 编辑
摘要: Description Farmer John's N cows (1 ≤ N ≤ 100,000) share many similarities. In fact, FJ has been able to narrow down the list of features shared by hi 阅读全文
posted @ 2018-08-10 10:04 岩扉 阅读(340) 评论(0) 推荐(0) 编辑
摘要: Description You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your progra 阅读全文
posted @ 2018-08-09 18:33 岩扉 阅读(280) 评论(0) 推荐(0) 编辑
摘要: 题目描述 回到家中的猫猫把三桶鱼全部转移到了她那长方形大池子中,然后开始思考:到底要以何种方法吃鱼呢(猫猫就是这么可爱,吃鱼也要想好吃法 ^_*)。她发现,把大池子视为01矩阵(0表示对应位置无鱼,1表示对应位置有鱼)有助于决定吃鱼策略。 在代表池子的01矩阵中,有很多的正方形子矩阵,如果某个正方形 阅读全文
posted @ 2018-08-09 15:34 岩扉 阅读(217) 评论(0) 推荐(0) 编辑
摘要: Problem Description There are several ancient Greek texts that contain descriptions of the fabled island Atlantis. Some of these texts even include ma 阅读全文
posted @ 2018-08-08 22:19 岩扉 阅读(234) 评论(0) 推荐(0) 编辑
摘要: a is an array of n positive integers, all of which are not greater than n. You have to process q queries to this array. Each query is represented by t 阅读全文
posted @ 2018-08-08 11:06 岩扉 阅读(369) 评论(0) 推荐(0) 编辑
摘要: Problem Description 度度熊的字符串课堂开始了!要以像度度熊一样的天才为目标,努力奋斗哦! 为了检验你是否具备不听课的资质,度度熊准备了一个只包含大写英文字母的字符串 A[1,n] = a_1 a_2 \cdots a_nA[1,n]=a​1​​a​2​​⋯a​n​​,接下来他会向 阅读全文
posted @ 2018-08-07 14:18 岩扉 阅读(368) 评论(0) 推荐(0) 编辑
摘要: 题目描述 如题,已知一个数列,你需要进行下面三种操作: 1.将某区间每一个数乘上x 2.将某区间每一个数加上x 3.求出某区间每一个数的和 输入输出格式 输入格式: 第一行包含三个整数N、M、P,分别表示该数列数字的个数、操作的总个数和模数。 第二行包含N个用空格分隔的整数,其中第i个数字表示数列第 阅读全文
posted @ 2018-08-07 13:41 岩扉 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 题目描述 Kanade selected n courses in the university. The academic credit of the i-th course is s[i] and the score of the i-th course is c[i]. At the univ 阅读全文
posted @ 2018-08-04 10:24 岩扉 阅读(327) 评论(0) 推荐(0) 编辑
摘要: 题目描述 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意两只袜子是不是完整的一双,甚至不在意两只袜子是否一左一右, 阅读全文
posted @ 2018-08-03 20:46 岩扉 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 题目描述 小B有一个序列,包含N个1~K之间的整数。他一共有M个询问,每个询问给定一个区间[L..R],求Sigma(c(i)^2)的值,其中i的值从1到K,其中c(i)表示数字i在[L..R]中的重复次数。小B请你帮助他回答询问。 输入输出格式 输入格式: 第一行,三个整数N、M、K。 第二行,N 阅读全文
posted @ 2018-08-03 10:50 岩扉 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 题目描述 HH 有一串由各种漂亮的贝壳组成的项链。HH 相信不同的贝壳会带来好运,所以每次散步完后,他都会随意取出一段贝壳,思考它们所表达的含义。HH 不断地收集新的贝壳,因此,他的项链变得越来越长。有一天,他突然提出了一个问题:某一段贝壳中,包含了多少种不同的贝壳?这个问题很难回答……因为项链实在 阅读全文
posted @ 2018-08-02 20:31 岩扉 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coordinates. Let the leve 阅读全文
posted @ 2018-08-01 21:49 岩扉 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Description For the daily milking, Farmer John's N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a g 阅读全文
posted @ 2018-08-01 10:54 岩扉 阅读(241) 评论(0) 推荐(0) 编辑