2022年11月19日
摘要: Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(17) 评论(0) 推荐(0)
摘要: Description While exploring his many farms, Farmer John hasdiscovered a number of amazing wormholes. A wormhole is very peculiar b... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(36) 评论(0) 推荐(0)
摘要: Description 监狱有连续编号为1...N的N个房间,每个房间关押一个犯人,有M种宗教,每个犯人可能信仰其中一种。如果 相邻房间的犯人的宗教相同,就可能发生越狱,求有多少种状态可能发生越狱 Input 输入两个整数M,N.1#incl... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(48) 评论(0) 推荐(0)
摘要: Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformat... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(21) 评论(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 d... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(31) 评论(0) 推荐(0)
摘要: Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clo... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(27) 评论(0) 推荐(0)
摘要: Description Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global thre... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(25) 评论(0) 推荐(0)
摘要: Description The system of Martians' blood relations is confusing enough. Actually, Martians bud when they want and where they wan... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(0) 评论(0) 推荐(0)
摘要: Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wake... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(21) 评论(0) 推荐(0)
摘要: Description Bessie has been hired to build a cheap internet network among Farmer John's N (2 #include#includeusing namespace std;... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(22) 评论(0) 推荐(0)
摘要: Description Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(37) 评论(0) 推荐(0)
摘要: Description The French author Georges Perec (1936–1982) once wrote a book, La disparition, without the letter 'e'. He was a memb... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(27) 评论(0) 推荐(0)
摘要: Description There are so many different religions in the world today that it is difficult to keep track of them all. You are inte... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(22) 评论(0) 推荐(0)
摘要: Description A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a reque... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Description A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numb... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(32) 评论(0) 推荐(0)
摘要: Description Consider the two networks shown below. Assuming that data moves around these networks only between directly connected... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(22) 评论(0) 推荐(0)
摘要: Description A number of schools are connected to a computer network. Agreements have been developed among those schools: each sch... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(25) 评论(0) 推荐(0)
摘要: Description 作为一个生活散漫的人,小Z每天早上都要耗费很久从一堆五颜六色的袜子中找出一双来穿。终于有一天,小Z再也无法忍受这恼人的找袜子过程,于是他决定听天由命…… 具体来说,小Z把这N只袜子从1到N编号,然后从编号L到R(L 尽管小Z并不在意... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(54) 评论(0) 推荐(0)
摘要: Description Fermat's theorem states that for any prime number p and for any integer a > 1, ap = a (mod p). That is, if we raise ... 阅读全文
posted @ 2022-11-19 21:13 TLECODE 阅读(24) 评论(0) 推荐(0)
摘要: Description 硬币购物一共有4种硬币。面值分别为c1,c2,c3,c4。某人去商店买东西,去了tot次。每次带di枚ci硬币,买s i的价值的东西。请问每次有多少种付款方法。 Input 第一行 c1,c2,c3,c4,tot 下面tot行 ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Description 已知多项式方程: a0+a1*x+a2*x^2+...+an*x^n=0 求这个方程在[1,m]内的整数解(n和m均为正整数)。 Input 第一行包含2个整数n、m,每两个整数之间用一个空格隔开。 接下来的n+1行每行包含一个整数,... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description 每一头牛的愿望就是变成一头最受欢迎的牛。现在有N头牛,给你M对整数(A,B),表示牛A认为牛B受欢迎。 这 种关系是具有传递性的,如果A认为B受欢迎,B认为C受欢迎,那么牛A也认为牛C受欢迎。你的任务是求出有多少头 牛被所有的牛认为... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(13) 评论(0) 推荐(0)
摘要: Description 现在电视台有一种节目叫做超级英雄,大概的流程就是每位选手到台上回答主持人的几个问题,然后根据回答问题的 多少获得不同数目的奖品或奖金。主持人问题准备了若干道题目,只有当选手正确回答一道题后,才能进入下一题 ,否则就被淘汰。为了增加节目的... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description OI island是一个非常漂亮的岛屿,自开发以来,到这儿来旅游的人很多。然而,由于该岛屿刚刚开发不久,所以那 里的交通情况还是很糟糕。所以,OIER Association组织成立了,旨在建立OI island的交通系统。 OI is... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Description 多边形相邻边垂直,边长为整数,边平行坐标轴。要在多边形的点上放一些激光发射器和接收器。满足下列要求: 1发射器和接收器不能放置在同一点; 2发射器发出激光可以沿壁反射,最终到达一个接收器; 3发射器只能沿角平分线发射激光。求:最多可放置... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(32) 评论(0) 推荐(0)
摘要: Description 除法表达式有如下的形式: X1/X2/X3.../Xk 其中Xi是正整数且Xi#includeusing namespace std;int gcd(int a,int b){ int t; while(b){ ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(6) 评论(0) 推荐(0)
摘要: Description 给出圆周上的若干个点,已知点与点之间的弧长,其值均为正整数,并依圆周顺序排列。 请找出这些点中有没有可以围成矩形的,并希望在最短时间内找出所有不重复矩形。 Input 第一行为正整数N,表示点的个数,接下来N行分别为这N个点所分割的各个... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(21) 评论(0) 推荐(0)
摘要: Description 酷爱日料的小Z经常光顾学校东门外的回转寿司店。在这里,一盘盘寿司通过传送带依次呈现在小Z眼前。不同的寿 司带给小Z的味觉感受是不一样的,我们定义小Z对每盘寿司都有一个满意度,例如小Z酷爱三文鱼,他对一盘三文 鱼寿司的满意度为10;小Z觉... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(36) 评论(0) 推荐(0)
摘要: Description 某公司加工一种由铁、铝、锡组成的合金。他们的工作很简单。首先进口一些铁铝锡合金原材料,不同种类的 原材料中铁铝锡的比重不同。然后,将每种原材料取出一定量,经过融解、混合,得到新的合金。新的合金的铁铝 锡比重为用户所需要的比重。 现在... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(12) 评论(0) 推荐(0)
摘要: Description 对于一个给定的S={a1,a2,a3,…,an},若有P={ax1,ax2,ax3,…,axm},满足(x1 #include#includeusing namespace std;const int N=10005;int a[N... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(13) 评论(0) 推荐(0)
摘要: Description 求一个给定的圆(x^2+y^2=r^2),在圆周上有多少个点的坐标是整数。Input 只有一个正整数n,n#include#include#define ll long longusing namespace std;int main(... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(15) 评论(0) 推荐(0)
摘要: Description Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instan... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Description 这道题是一个计算几何,由于矩形的两条对角线互相平分且相等,所以可以先构造出所有的线段,并按长度,中点坐标排序,这样长度和中点坐标相等的线段就被放在相邻位置,然后暴力枚举即可,下面是程序:#include#include#include#... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Description 对于正整数n,定义f(n)为n所含质因子的最大幂指数。例如f(1960)=f(2^3 * 5^1 * 7^2)=3, f(10007)=1, f(1)=0。给定正整数a,b,求sigma(sigma(f(gcd(i,j)))) (i=1... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(9) 评论(0) 推荐(0)
摘要: Description 鬼谷子非常聪明,正因为这样,他非常繁忙,经常有各诸侯车的特派员前来向他咨询时政。有一天,他在咸阳游历的时候,朋友告诉他在咸阳最大的拍卖行(聚宝商行)将要举行一场拍卖会,其中有一件宝物引起了他极大的兴趣,那就是无字天书。但是,他的行程... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(15) 评论(0) 推荐(0)
摘要: Problem Description 给出组合数C(n,m), 表示从n个元素中选出m个元素的方案数。例如C(5,2) = 10, C(4,2) = 6.可是当n,m比较大的时候,C(n,m)很大!于是xiaobo希望你输出 C(n,m) mod ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(10) 评论(0) 推荐(0)
摘要: Problem Description M斐波那契数列F[n]是一种整数数列,它的定义如下: F[0] = a F[1] = b F[n] = F[n-1] * F[n-2] ( n > 1 ) 现在给出a, b, n,你能求出F[n]的值吗? ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(41) 评论(0) 推荐(0)
摘要: Description 现在给出了一个简单无向加权图。你不满足于求出这个图的最小生成树,而希望知道这个图中有多少个不同的 最小生成树。(如果两颗最小生成树中至少有一条边不同,则这两个最小生成树就是不同的)。由于不同的最小生 成树可能很多,所以你只需要输... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(18) 评论(0) 推荐(0)
摘要: Description 很久以前,在一个遥远的星系,一个黑暗的帝国靠着它的超级武器统治者整个星系。某一天,凭着一个偶然的 机遇,一支反抗军摧毁了帝国的超级武器,并攻下了星系中几乎所有的星球。这些星球通过特殊的以太隧道互相直 接或间接地连接。 但好景不... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Description 火星人最近研究了一种操作:求一个字串两个后缀的公共前缀。比方说,有这样一个字符串:madamimadam, 我们将这个字符串的各个字符予以标号:序号: 1 2 3 4 5 6 7 8 9 10 11 字符 m a d a m i... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(17) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.org/problem/show?pid=1886 题目描述 现在有一堆数字共N个数字(N#includeusing namespace std;const int N=1000005;struct nod... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(12) 评论(0) 推荐(0)
摘要: Problem Description People in Silverland use square coins. Not only they have square shapes but also their values are square n... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(11) 评论(0) 推荐(0)
摘要: Problem Description "Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 sa... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Description 有一个球形空间产生器能够在n维空间中产生一个坚硬的球体。现在,你被困在了这个n维球体中,你只知道球 面上n+1个点的坐标,你需要以最快的速度确定这个n维球体的球心坐标,以便于摧毁这个球形空间产生器。 Input 第一行... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(15) 评论(0) 推荐(0)
摘要: Description 现在请求你维护一个数列,要求提供以下两种操作:1、 查询操作。语法:Q L 功能:查询当前数列中末尾L 个数中的最大的数,并输出这个数的值。限制:L不超过当前数列的长度。2、 插入操作。语法:A n 功能:将n加 上t,其中t是... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Description 直线上N颗行星,X=i处有行星i,行星J受到行星I的作用力,当且仅当ij= Mi*Mj/(j-i) 其中A为很小的常量,故直观上说每颗行星都只受到距离遥远的行星的作用。请计算每颗行星的受力 ,只要结果的相对误差不超过5%即可. ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(23) 评论(0) 推荐(0)
摘要: Description P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京。他使用自己的压缩器进行压 缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中。P教授有编号为1...N的N件玩具,第i件玩具经过 压缩后变成一维长度为... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(18) 评论(0) 推荐(0)
摘要: Description 阿申准备报名参加GT考试,准考证号为N位数X1X2....Xn(0#includeusing namespace std;char a[25];int n,m,mod,next[25],s[25][25],r[25][25];v... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(13) 评论(0) 推荐(0)
摘要: Description 在xoy直角坐标平面上有n条直线L1,L2,...Ln,若在y值为正无穷大处往下看,能见到Li的某个子线段,则称Li为 可见的,否则Li为被覆盖的. 例如,对于直线: L1:y=x; L2:y=-x; L3:y=0 则L1和L2... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(21) 评论(0) 推荐(0)
摘要: Description K国是一个热衷三角形的国度,连人的交往也只喜欢三角原则.他们认为三角关系:即AB相互认识,BC相互认识,CA 相互认识,是简洁高效的.为了巩固三角关系,K国禁止四边关系,五边关系等等的存在.所谓N边关系,是指N个人 A1A2 .... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(16) 评论(0) 推荐(0)
摘要: Description 自从明明学了树的结构,就对奇怪的树产生了兴趣......给出标号为1到N的点,以及某些点最终的度数,允许在 任意两点间连线,可产生多少棵度数满足要求的树? Input 第一行为N(0 #include#include... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(17) 评论(0) 推荐(0)
摘要: Description 小春现在很清闲,面对书桌上的N张牌,他决定给每张染色,目前小春只有3种颜色:红色,蓝色,绿色.他询问Sun有 多少种染色方案,Sun很快就给出了答案.进一步,小春要求染出Sr张红色,Sb张蓝色,Sg张绝色.他又询问有多少种方 案... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(7) 评论(0) 推荐(0)
摘要: Description 物流公司要把一批货物从码头A运到码头B。由于货物量比较大,需要n天才能运完。货物运输过程中一般要转 停好几个码头。物流公司通常会设计一条固定的运输路线,以便对整个运输过程实施严格的管理和跟踪。由于各种 因素的存在,有的时候某个码... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(15) 评论(0) 推荐(0)
摘要: Description 轮状病毒有很多变种,所有轮状病毒的变种都是从一个轮状基产生的。一个N轮状基由圆环上N个不同的基原子 和圆心处一个核原子构成的,2个原子之间的边表示这2个原子之间的信息通道。如下图所示 N轮状病毒的产生规律是在一个... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(42) 评论(0) 推荐(0)
摘要: Description 现在小朋友们最喜欢的"喜羊羊与灰太狼",话说灰太狼抓羊不到,但抓兔子还是比较在行的, 而且现在的兔子还比较笨,它们只有两个窝,现在你做为狼王,面对下面这样一个网格的地形: 左上角点为(1,1),右下角点为(... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(21) 评论(0) 推荐(0)
摘要: Problem Description We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently,... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(18) 评论(0) 推荐(0)
摘要: Description In the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(15) 评论(0) 推荐(0)
摘要: Description 贝茜把家搬到了一个小农场,但她常常回到FJ的农场去拜访她的朋友。贝茜很喜欢路边的风景,不想那么快地结束她的旅途,于是她每次回农场,都会选择第二短的路径,而不象我们所习惯的那样,选择最短路。 贝茜所在的乡村有R(1 2 -> 4 (长度为... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(22) 评论(0) 推荐(0)
摘要: Description 每天,农夫 John 的N(1 #includeusing namespace std;const int N=50005;int st[2][Nb?a:b;}int min(int a,int b){ return a>1]+1; }... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(16) 评论(0) 推荐(0)
摘要: Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成 一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点的最大... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description 小刚在玩JSOI提供的一个称之为“建筑抢修”的电脑游戏:经过了一场激烈的战斗,T部落消灭了所有z部落的 入侵者。但是T部落的基地里已经有N个建筑设施受到了严重的损伤,如果不尽快修复的话,这些建筑设施将会完全 毁坏。现在的情况是:T部... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(31) 评论(0) 推荐(0)
摘要: Description windy学会了一种游戏。对于1到N这N个数字,都有唯一且不同的1到N的数字与之对应。最开始windy把数字按 顺序1,2,3,……,N写一排在纸上。然后再在这一排下面写上它们对应的数字。然后又在新的一排下面写上它们 对应的数字。如... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Description windy的生日到了,为了庆祝生日,他的朋友们帮他买了一个边长分别为 X 和 Y 的矩形蛋糕。现在包括windy ,一共有 N 个人来分这块大蛋糕,要求每个人必须获得相同面积的蛋糕。windy主刀,每一切只能平行于一块蛋糕 的一边(... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description 同一时刻有N位车主带着他们的爱车来到了汽车维修中心。维修中心共有M位技术人员,不同的技术人员对不同 的车进行维修所用的时间是不同的。现在需要安排这M位技术人员所维修的车及顺序,使得顾客平均等待的时间最 小。 说明:顾客的等待时间是指... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(17) 评论(0) 推荐(0)
摘要: Description 战犯们企图逃离监狱,他们详细地计划了如何逃出监狱本身,逃出监狱之后他们希望在附近的一个村子里找到掩护。村子(下图中的B)和监狱(图中的A)中间有一个峡谷,这个峡谷也是有士兵守卫的。守卫峡谷的士兵们坐在岗哨上很少走动,每个士兵的观察范围是... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(25) 评论(0) 推荐(0)
摘要: Description Farmer John has built a new long barn, with N (2 #include#includeusing namespace std;const int N=100005;int a[N],n,c;b... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Description 在国际象棋和中国象棋中,马的移动规则相同,都是走“日”字,我们将这种移动方式称为马步移动。如图所示, 从标号为 0 的点出发,可以经过一步马步移动达到标号为 1 的点,经过两步马步移动达到标号为 2 的点。任给 平面上的两点 p 和... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(60) 评论(0) 推荐(0)
摘要: Description 给你一个n个数的数列,其中某个数出现了超过n div 2次即众数,请你找出那个数。 Input 第1行一个正整数n。 第2行n个正整数用空格隔开。 Output 一行一个正整数表示那个众数。 Sample Input 5 3 2... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description 对于任何正整数x,其约数的个数记作g(x)。例如g(1)=1、g(6)=4。如果某个正整数x满足:g(x)>g(i) 0且),然后由约数个数定律(设则的约数个数为),可得越小的质数对于更有利,所以枚举前12个质数即可,下面是程序... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(39) 评论(0) 推荐(0)
摘要: Description 小明和小红经常玩一个博弈游戏。给定一个n×n的棋盘,一个石头被放在棋盘的左上角。他们轮流移动石头。每一回合,选手只能把石头向上,下,左,右四个方向移动一格,并且要求移动到的格子之前不能被访问过。谁不能移动石头了就算输。假如小明先移动石头... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(10) 评论(0) 推荐(0)
摘要: Description In this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(17) 评论(0) 推荐(0)
摘要: Description The Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 #include#de... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(18) 评论(0) 推荐(0)
摘要: Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be he... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(15) 评论(0) 推荐(0)
摘要: Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In t... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(13) 评论(0) 推荐(0)
摘要: Description It is well known that a human gene can be considered as a sequence, consisting of four nucleotides, which are simply ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(12) 评论(0) 推荐(0)
摘要: Description Given a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size ... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Description Given n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b a... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Description The input contains N natural (i.e. positive integer) numbers ( N #includeusing namespace std;int t[10005],a[10005];in... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(10) 评论(0) 推荐(0)
摘要: Description A Compiler Mystery: We are given a C-language style for loop of type for (variable = A; variable != B; variable +=... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(30) 评论(0) 推荐(0)
摘要: Description Everybody in the Prime Land is using a prime base number system. In this system, each positive integer x is represent... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(20) 评论(0) 推荐(0)
摘要: Problem Description Kingdom Rush is a popular TD game, in which you should build some towers to protect your kingdom from monst... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(22) 评论(0) 推荐(0)
摘要: Description Astronomers often examine star maps where stars are represented by points on a plane and each star has Cartesian coor... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(14) 评论(0) 推荐(0)
摘要: Problem Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(46) 评论(0) 推荐(0)
摘要: Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(12) 评论(0) 推荐(0)
摘要: Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(16) 评论(0) 推荐(0)
摘要: Problem Description 某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(25) 评论(0) 推荐(0)
摘要: Problem Description 虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(52) 评论(0) 推荐(0)
摘要: Description BIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory m... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(12) 评论(0) 推荐(0)
摘要: Description Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to al... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(8) 评论(0) 推荐(0)
摘要: Description 给定一张有向图,每条边都有一个容量C和一个扩容费用W。这里扩容费用是指将容量扩大1所需的费用。求: 1、 在不扩容的情况下,1到N的最大流; 2、 将1到N的最大流增加K所需的最小扩容费用。 Input 输入文件的第一行包含三个整数N,... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(13) 评论(0) 推荐(0)
摘要: Description 两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(12) 评论(0) 推荐(0)
摘要: Description Farmer John completed his new barn just last week, complete with all the latest milking technology. Unfortunately, du... 阅读全文
posted @ 2022-11-19 21:12 TLECODE 阅读(18) 评论(0) 推荐(0)
摘要: Description 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问。墨墨会像你发布如下指令: 1、 Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜色的画笔。 2、 R P Col 把第P支画笔替换为颜色Co... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(27) 评论(0) 推荐(0)
摘要: Description 在经济全球化浪潮的影响下,习惯于漫步在清晨的乡间小路的邮递员Blue Mary也开始骑着摩托车传递邮件了。 不过,她经常回忆起以前在乡间漫步的情景。昔日,乡下有依次编号为1..n的n个小村庄,某些村庄之间有一些双 向的土路。从每个村... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(8) 评论(0) 推荐(0)
摘要: Description 给出平面上N个点,N#include#include#include#includeusing namespace std;const int N=100005;const double eps=1e-10;struct Point{ ... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(23) 评论(0) 推荐(0)
摘要: Description Farmer John尝试通过和奶牛们玩益智玩具来保持他的奶牛们思维敏捷. 其中一个大型玩具是牛栏中的灯. N (2 * * O O 改变灯 1 和 2 的状态 0 2 4 -> * O * * 1 2 3 -> 1 输出在2..3的... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(19) 评论(0) 推荐(0)
摘要: Description HH有一串由各种漂亮的贝壳组成的项链。HH相信不同的贝壳会带来好运,所以每次散步 完后,他都会随意取出一 段贝壳,思考它们所表达的含义。HH不断地收集新的贝壳,因此他的项链变得越来越长。有一天,他突然提出了一 个问题:某一段贝壳中,包含... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(7) 评论(0) 推荐(0)
摘要: Description Input 第一行是两个整数N(3 N 200000)和M,分别表示居住点总数和街道总数。以下M行,每行给出一条街道的信息。第i+1行包含整数Ui、Vi、Ti(1Ui, Vi N,1 Ti 1000000000),表示街道i... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(16) 评论(0) 推荐(0)
摘要: Description 一个N*M的方格,初始时每个格子有一个整数权值,接下来每次有2个操作: 改变一个格子的权值 求一个子矩阵中某个特定权值出现的个数 Input 每一行有两个数字N,M 接下来N行,每行M个数字。第i+1行第j个数字表示格子(i,j)的初值... 阅读全文
posted @ 2022-11-19 21:11 TLECODE 阅读(8) 评论(0) 推荐(0)