05 2019 档案
摘要:Jimmy experiences a lot of stress at work these days, especially since his accident made working difficult. To relax after a hard day, he likes to wal
阅读全文
摘要:题目描述 给定N个线段。求有交点的线段对数。保证没有两条线段共线 输入 一行一个整数N,表示线段的个数第2~N+1行,每行四个实数,x1,y1,x2,y2,表示线段的两个端点(x1,y1)和(x2,y2) 输出 一行一个整数,表示有交点的线段对数。 样例输入 复制样例数据 样例输出 提示 (0,0)
阅读全文
摘要:Holion August will eat every thing he has found. Now there are many foods,but he does not want to eat all of them at once,so he find a sequence. fn=⎧⎩
阅读全文
摘要:如果两个集合存储颜色的情况相同,说明这两个在k个图中都是在一个集合的 学到的点:用map,将vector映射一个整数时,只有vector后面的邻接的数据都一样时,才认为两个vector一样 代码:
阅读全文
摘要:看从当前点到到不是1的点的位置,从奇偶性判断 代码:
阅读全文
摘要:思路:上下扫,注意一点细节处理就好了 代码:
阅读全文
摘要:题目描述 小明买了块高端大气上档次的电子手表,他正准备调时间呢。在 M78 星云,时间的计量单位和地球上不同,M78 星云的一个小时有 n 分钟。大家都知道,手表只有一个按钮可以把当前的数加一。在调分钟的时候,如果当前显示的数是 0 ,那么按一下按钮就会变成 1,再按一次变成 2 。如果当前的数是
阅读全文
摘要:A. Telephone Number A telephone number is a sequence of exactly 11 digits, where the first digit is 8. For example, the sequence 80011223388 is a tele
阅读全文
摘要:In some social network, there are nn users communicating with each other in mm groups of friends. Let's analyze the process of distributing some news
阅读全文
摘要:A. Remainder output standard output output standard output output You are given a huge decimal number consisting of nn digits. It is guaranteed that t
阅读全文
摘要:USTC campus network is a huge network. There is a bi-directional link between every pair of computers in the network. One of the computers is the BBS
阅读全文
摘要:Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luck
阅读全文
摘要:Problem Description Once upon a time Matt went to a small town. The town was so small and narrow that he can regard the town as a pivot. There were so
阅读全文
摘要:恢复内容开始 We guessed some integer number xx. You are given a list of almost all its divisors. Almost all means that there are all divisors except 11and x
阅读全文
摘要:Description 又到了一年一度ACMer暑期留校集训的日子了,目前一共有2n+1个小萌新报名参加暑期集训,其中2n个是帅哥,只有1个萌妹子,这是多么的悲催!由于暑期训练强度大,坚持下来可不是一件容易的事情,DHG学长想到了一个巧妙的方法,两个人组成一队,两人互相鼓励,互相监督,直到集训顺利完
阅读全文
摘要:题目描述 任何大于 1 的自然数 n 都可以写成若干个大于等于 2 且小于等于 n 的质数之和表达式(包括只有一个数构成的和表达式的情况),并且可能有不止一种质数和的形式。例如,9 的质数和表达式就有四种本质不同的形式: 9 = 2 + 5 + 2 = 2 + 3 + 2 + 2 = 3 + 3 +
阅读全文
摘要:Mr. Kitayuta has just bought an undirected graph consisting of n vertices and medges. The vertices of the graph are numbered from 1 to n. Each edge, n
阅读全文
摘要:Chinese Postman Problem is a very famous hard problem in graph theory. The problem is to find a shortest closed path or circuit that visits every edge
阅读全文
摘要:Let’s start with a very classical problem. Given an array a[1…n] of positive numbers, if the value of each element in the array is distinct, how to fi
阅读全文
摘要:Are you interested in pets? There is a very famous pets shop in the center of the ACM city. There are totally m pets in the shop, numbered from 1 to m
阅读全文
摘要:There is a set of matrixes that are constructed subject to the following constraints: 1. The matrix is a S(n)×S(n) matrix; 2. S(n) is the sum of the f
阅读全文
摘要:给定一个长度为n的数列ai,求ai的子序列bi的最长长度,满足bi&bi-1!=0(2<=i<=len)。 Input 输入文件共2行。 第一行包括一个整数n。 第二行包括n个整数,第i个整数表示ai。 Output 输出文件共一行。 包括一个整数,表示子序列bi的最长长度。 Sample Inpu
阅读全文
摘要:There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help
阅读全文
摘要:There are n integers a 1,a 2,…,a n-1,a n in the sequence A, the sum of these n integers is larger than zero. There are n integers b 1,b 2,…,b n-1,b n
阅读全文
摘要:Mine sweeper is a very popular small game in Windows operating system. The object of the game is to find mines, and mark them out. You mark them by cl
阅读全文
摘要:You've got a string s = s1s2... s|s| of length |s|, consisting of lowercase English letters. There also are q queries, each query is described by two
阅读全文
摘要:You are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock.
阅读全文
摘要:We give the following inductive definition of a “regular brackets” sequence: the empty sequence is a regular brackets sequence, if s is a regular brac
阅读全文
摘要:One curious child has a set of N little bricks. From these bricks he builds different staircases. Staircase consists of steps of different sizes in a
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/893/F来源:牛客网 输出描述: 示例1 输入 复制 2 5 1 00101 2 1 01 输出 复制 4 2 说明 第一个串翻转第三个位置,00001的价值为4;第二个串翻转第一个位置,11的价值为2。思路:记录每个串
阅读全文
摘要:The cows are going to space! They plan to achieve orbit by building a sort of space elevator: a giant tower of blocks. They have K (1 <= K <= 400) dif
阅读全文
摘要:linux在当前目录下新建文件需要的命令是mkdir 文件名 然后进入新建的文件的命令是cd 文件名 返回上一层是cd .. 新建一个c语言程序的过程是先打开vim 编译器 ,然后写完后进行输入esc 输入:w进行保存 再输入:q进行退出然后进行编译链接,主要的命令是gcc -c 文件名.c。编译结
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/893/C来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言65536K 64bit IO Format: %lld 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/893/D来源:牛客网 题目描述 有n堆石子排成一排,第i堆石子有aiai个石子。 每次,你可以选择任意相邻的两堆石子进行合并,合并后的石子数量为两堆石子的和,消耗的体力等价于两堆石子中石子数少的那个。 请问,将所有的石子
阅读全文
摘要:The math faculty of Berland State University has suffered the sudden drop in the math skills of enrolling students. This year the highest grade on the
阅读全文
摘要:题目描述 模拟程序型计算器,依次输入指令,可能包含的指令有1. 数字:'NUM X',X为一个只包含大写字母和数字的字符串,表示一个当前进制的数2. 运算指令:'ADD','SUB','MUL','DIV','MOD',分别表示加减乘,除法取商,除法取余3. 进制转换指令:'CHANGE K',将当
阅读全文
摘要:小明的实验室有N台电脑,编号1~N。原本这N台电脑之间有N-1条数据链接相连,恰好构成一个树形网络。在树形网络上,任意两台电脑之间有唯一的路径相连。不过在最近一次维护网络时,管理员误操作使得某两台电脑之间增加了一条数据链接,于是网络中出现了环路。环路上的电脑由于两两之间不再是只有一条路径,使得这些电
阅读全文
摘要:w星球的一个种植园,被分成 m * n 个小格子(东西方向m行,南北方向n列)。每个格子里种了一株合根植物。这种植物有个特点,它的根可能会沿着南北或东西方向伸展,从而与另一个格子的植物合成为一体。 如果我们告诉你哪些小格子间出现了连根现象,你能说出这个园中一共有多少株合根植物吗? 第一行,两个整数m
阅读全文
摘要:Floor problem In this problem, we have f(n,x)=Floor[n/x]. Here Floor[x] is the biggest integer such that no larger than x. For example, Floor[1.1]=Flo
阅读全文
摘要:题目描述 小明喜欢在一个围棋网站上找别人在线对弈。这个网站上所有注册用户都有一个积分,代表他的围棋水平。小明发现网站的自动对局系统在匹配对手时,只会将积分差恰好是K的两名用户匹配在一起。如果两人分差小于或大于K,系统都不会将他们匹配。现在小明知道这个网站总共有N名用户,以及他们的积分分别是A1, A
阅读全文
摘要:Description 小明来到青岛上学已经一年了,他给青岛这座城市画了一张地图。在这个地图上有n个点,小明的起始点为1号点,终点为n号点,并且地图上的所有边都是单向的。小明知道从i号点到j号点的时间花费为w分钟,那么问题来了,求从1号点到n号的最小时间花费是多少?这个最少花费的路径有多少条? In
阅读全文
摘要:Description 小Q手里有n(n<=1000) 个硬币,每枚硬币有一定的金额(200=>x>=1)他想知道,用这些硬币(每枚硬币只能用一次,但可能会有等面值的用两次) 能组成多少种不同的金额? Input 第一行 n,表示第二行一共有n个数字,第二行 表示n个数字 Output 第一行 输出
阅读全文
摘要:Simon has a prime number x and an array of non-negative integers a1, a2, ..., an. Simon loves fractions very much. Today he wrote out number on a piec
阅读全文
摘要:不死族的巫妖王发工资拉,死亡骑士拿到一张N元的钞票(记住,只有一张钞票),为了防止自己在战斗中频繁的死掉,他决定给自己买一些道具,于是他来到了地精商店前. 死亡骑士:"我要买道具!" 地精商人:"我们这里有三种道具,血瓶150块一个,魔法药200块一个,无敌药水350块一个." 死亡骑士:"好的,给
阅读全文
摘要:Consider the natural numbers from 1 to N. By associating to each number a sign (+ or -) and calculating the value of this expression we obtain a sum S
阅读全文
摘要:记录一下自己一点大学获奖经历 2018.10 山东省高校机器人大赛 二等奖 2018.12 青岛大学电子设计竞赛 一等奖 2018.12 青岛大学第一届程序设计大赛 冠军 2019.3 第十届蓝桥杯山东省赛 一等奖 2019.4 计算机科学与技术学院图灵杯编程大赛 冠军 2019.5 山东省acm程
阅读全文
摘要:一个规则的实心十二面体,它的 20个顶点标出世界著名的20个城市,你从一个城市出发经过每个城市刚好一次后回到出发的城市。 Input前20行的第i行有3个数,表示与第i个城市相邻的3个城市.第20行以后每行有1个数m,m<=20,m>=1.m=0退出. Output输出从第m个城市出发经过每个城市1
阅读全文