04 2020 档案
摘要:endl:换行 fixed:用一般的方式输出浮点数(在iostream头文件里) specify that (for output sent to the cout stream) decimal format (not scientific notation) be used, and that
阅读全文
摘要:1.Responsibility Driven Design(责任驱动设计) 2. Behavior(行为) and State(状态) Instances(实例) and Classes(类) Coupling(耦合) and Cohesion(内聚) Interface(接口) an
阅读全文
摘要:主要是一些名词Q^Q 1.头文件:It is common to place struct type declarations with TypeNames in a (.h) header file and # include that file. 不要在头文件用using,这样的话可能导致某些c
阅读全文
摘要:1. Constructors(构造函数) 函数名即类名,无返回值,为对象开辟存储空间时自动调用。可使用初始化器:PlayingCard (Suits is, int ir) : suitValue (is), rankValue (ir) { } 2. Default Constructor(缺省
阅读全文
摘要:You are given an undirected unweighted graph consisting of nn vertices and mm edges (which represents the map of Bertown) and the array of prices pp o
阅读全文
摘要:You are given an array aa consisting of nn integers (it is guaranteed that nn is even, i.e. divisible by 22 ). All aiai does not exceed some integer k
阅读全文
摘要:Recall that the sequence bb is a a subsequence of the sequence aa if bb can be derived from aa by removing zero or more elements without changing the
阅读全文
摘要:You are given a positive integer nn , it is guaranteed that nn is even (i.e. divisible by 22 ). You want to construct the array aa of length nn such t
阅读全文
摘要:Recently Vova found nn candy wrappers. He remembers that he bought xx candies during the first day, 2x2x candies during the second day, 4x4x candies d
阅读全文
摘要:题目背景 我是源点,你是终点。我们之间有负权环。 ——小明 题目描述 在小明和小红的生活中,有 NNN 个关键的节点。有 MMM 个事件,记为一个三元组 (Si,Ti,Wi)(S_i,T_i,W_i)(Si,Ti,Wi),表示从节点 SiS_iSi 有一个事件可以转移到 TiT_iTi,事
阅读全文
摘要:题目描述 John 在他的农场中闲逛时发现了许多虫洞。虫洞可以看作一条十分奇特的有向边,并可以使你返回到过去的一个时刻(相对你进入虫洞之前)。 John 的每个农场有 mmm 条小路(无向边)连接着 nnn 块地(从 1∼n1 \sim n1∼n 标号),并有 www 个虫洞。 现在 John 想借
阅读全文
摘要:http://www.matrix67.com/blog/archives/276
阅读全文
摘要:题目描述 给定一个 nnn 个点的有向图,请求出图中是否存在从顶点 111 出发能到达的负环。 负环的定义是:一条边权之和为负数的回路。 输入格式 本题单测试点有多组测试数据。 输入的第一行是一个整数 TTT,表示测试数据的组数。对于每组数据的格式如下: 第一行有两个整数,分别表示图的边数 nnn
阅读全文
摘要:题目描述 Farmer John 的农场里有很多牧区。有的路径连接一些特定的牧区。一片所有连通的牧区称为一个牧场。但是就目前而言,你能看到至少有两个牧区通过任何路径都不连通。这样,Farmer John 就有多个牧场了。 John 想在牧场里添加恰好一条路径。对这条路径有以下限制: 一个牧场的直径就
阅读全文
摘要:题目描述 又到了一年一度的明明生日了,明明想要买BBB样东西,巧的是,这BBB样东西价格都是AAA元。 但是,商店老板说最近有促销活动,也就是: 如果你买了第III样东西,再买第JJJ样,那么就可以只花KI,JK_{I,J}KI,J元,更巧的是,KI,JK_{I,J}KI,J竟然等于KJ,IK_
阅读全文
摘要:题干描述来自https://www.cnblogs.com/ZKYAAA/p/12730937.html 自己记不清了QAQ 第一题 问题描述 在计算机存储中,12.5MB是多少字节? 答案提交 这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一个整数,在提交答案时只填写这个整数,填写
阅读全文
摘要:题目背景 “咚咚咚……”“查水表!”原来是查水表来了,现在哪里找这么热心上门的查表员啊!小明感动的热泪盈眶,开起了门…… 题目描述 妈妈下班回家,街坊邻居说小明被一群陌生人强行押上了警车!妈妈丰富的经验告诉她小明被带到了 ttt 区,而自己在 sss 区。 该市有 mmm 条大道连接 nnn 个区,
阅读全文
摘要:题目背景 小杉坐在教室里,透过口袋一样的窗户看口袋一样的天空。 有很多云飘在那里,看起来很漂亮,小杉想摘下那样美的几朵云,做成棉花糖。 题目描述 给你云朵的个数NNN,再给你MMM个关系,表示哪些云朵可以连在一起。 现在小杉要把所有云朵连成KKK个棉花糖,一个棉花糖最少要用掉一朵云,小杉想知道他怎么
阅读全文
摘要:C. Kaavi and Magic Spell https://blog.csdn.net/qq_43676357/article/details/105559491?fps=1&locationNum=2 有时间仔细研究一下
阅读全文
摘要:题目描述 Xenia is a girl being born a noble. Due to the inflexibility and harshness of her family, Xenia has to find some ways to amuse herself. Recently
阅读全文
摘要:Writing light novels is the most important thing in Linova's life. Last night, Linova dreamed about a fantastic kingdom. She began to write a light no
阅读全文
摘要:Kana was just an ordinary high school girl before a talent scout discovered her. Then, she became an idol. But different from the stereotype, she is a
阅读全文
摘要:Ichihime is the current priestess of the Mahjong Soul Temple. She claims to be human, despite her cat ears. These days the temple is holding a math co
阅读全文
摘要:题目描述 设有一棵二叉树,如图: 其中,圈中的数字表示结点中居民的人口。圈边上数字表示结点编号,现在要求在某个结点上建立一个医院,使所有居民所走的路程之和为最小,同时约定,相邻接点之间的距离为 111。如上图中,若医院建在1 处,则距离和 =4+12+2×20+2×40=136=4+12+2\tim
阅读全文
摘要:题目描述 给出每个节点的两个儿子节点,建立一棵二叉树(根节点为 111),如果是叶子节点,则输入0 0。建好树后希望知道这棵二叉树的深度。二叉树的深度是指从根节点到叶子结点时,最多经过了几层。 最多有 10610^6106 个结点。 输入格式 无 输出格式 无 输入输出样例 输入 #1 复制 7 2
阅读全文
摘要:实验六:类和对象(二)实验目的: (1)掌握类的构造函数和析构函数的使用方法 (2)掌握对象数组和对象指针的使用方法实验内容: 重新编写实验五中的时间类Time,增加3个构造函数:缺省 构造函数、带3个参数的构造函数以及拷贝构造函数。要求: (1)利用不同的构造函数创建新对象; (2)利用new和d
阅读全文
摘要:题目描述 The only difference between easy and hard versions is constraints. You are given a sequence a a a consisting of n n n positive integers. Let's de
阅读全文
摘要:题目描述 You are given a correct solution of the sudoku puzzle. If you don't know what is the sudoku, you can read about it here. The picture showing the
阅读全文
摘要:题目描述 You have n n n students under your control and you have to compose exactly two teams consisting of some subset of your students. Each student had
阅读全文
摘要:题目描述 You are given three positive integers n n n , a a a and b b b . You have to construct a string s s s of length n n n consisting of lowercase Lati
阅读全文
摘要:题目描述 There are two sisters Alice and Betty. You have n n n candies. You want to distribute these n n n candies between two sisters in such a way that:
阅读全文
摘要:在完成了分配任务之后,西部314来到了楼兰古城的西部。 相传很久以前这片土地上(比楼兰古城还早)生活着两个部落,一个部落崇拜尖刀(‘V’),一个部落崇拜铁锹(‘∧’),他们分别用V和∧的形状来代表各自部落的图腾。 西部314在楼兰古城的下面发现了一幅巨大的壁画,壁画上被标记出了N个点,经测量发现这N
阅读全文
摘要:题目描述 如题,已知一个数列,你需要进行下面两种操作: 将某区间每一个数数加上 xxx; 求出某一个数的值。 输入格式 第一行包含两个整数 NNN、MMM,分别表示该数列数字的个数和操作的总个数。 第二行包含 NNN 个用空格分隔的整数,其中第 iii 个数字表示数列第 ii i 项的初始值。 接下
阅读全文
摘要:You have an array aa of length nn . For every positive integer xx you are going to perform the following operation during the xx -th second: Select so
阅读全文
摘要:You have array of nn numbers a1,a2,…,ana1,a2,…,an . Rearrange these numbers to satisfy |a1−a2|≤|a2−a3|≤…≤|an−1−an||a1−a2|≤|a2−a3|≤…≤|an−1−an| , where
阅读全文
摘要:You have integer nn. Calculate how many ways are there to fully cover belt-like area of 4n−24n−2 triangles with diamond shapes. Diamond shape consists
阅读全文
摘要:You are given a complete directed graph KnKn with nn vertices: each pair of vertices u≠vu≠v in KnKn have both directed edges (u,v)(u,v) and (v,u)(v,u)
阅读全文
摘要:You are playing another computer game, and now you have to slay nn monsters. These monsters are standing in a circle, numbered clockwise from 11 to nn
阅读全文
摘要:题目描述 小凯手中有两种面值的金币,两种面值均为正整数且彼此互素。每种金币小凯都有 无数个。在不找零的情况下,仅凭这两种金币,有些物品他是无法准确支付的。现在小 凯想知道在无法准确支付的物品中,最贵的价值是多少金币?注意:输入数据保证存在 小凯无法准确支付的商品。 输入格式 两个正整数 aaa 和
阅读全文
摘要:Many years ago Berland was a small country where only nn people lived. Each person had some savings: the ii -th one had aiai burles. The government co
阅读全文
摘要:output standard output Polycarp has recently created a new level in this cool new game Berlio Maker 85 and uploaded it online. Now players from all ov
阅读全文
摘要:Adera是Microsoft应用商店中的一款解谜游戏。 异象石是进入Adera中异时空的引导物,在Adera的异时空中有一张地图。 这张地图上有N个点,有N-1条双向边把它们连通起来。 起初地图上没有任何异象石,在接下来的M个时刻中,每个时刻会发生以下三种类型的事件之一: 地图的某个点上出现了异象
阅读全文
摘要:Eugene likes working with arrays. And today he needs your help in solving one challenging task. An array cc is a subarray of an array bb if cc can be
阅读全文
摘要:Once again, Boris needs the help of Anton in creating a task. This time Anton needs to solve the following problem: There are two arrays of integers a
阅读全文
摘要:Young boy Artem tries to paint a picture, and he asks his mother Medina to help him. Medina is very busy, that's why she asked for your help. Artem wa
阅读全文
摘要:题目描述 松鼠的新家是一棵树,前几天刚刚装修了新家,新家有nnn 个房间,并且有 n−1n-1n−1 根树枝连接,每个房间都可以相互到达,且俩个房间之间的路线都是唯一的。天哪,他居然真的住在“树”上。 松鼠想邀请****前来参观,并且还指定一份参观指南,他希望**能够按照他的指南顺序,先去 a1a_
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/549/C来源:牛客网 题目描述 小A最近开始沉迷买彩票,并且希望能够通过买彩票发家致富。已知购买一张彩票需要3元,而彩票中奖的金额分别为1,2,3,4元,并且比较独特的是这个彩票中奖的各种金额都是等可能的。现在小A连续购
阅读全文
摘要:Dreamoon likes coloring cells very much. There is a row of nn cells. Initially, all cells are empty (don't contain any color). Cells are numbered from
阅读全文
摘要:The sequence of mm integers is called the permutation if it contains all integers from 11 to mm exactly once. The number mm is called the length of th
阅读全文
摘要:Dreamoon is a big fan of the Codeforces contests. One day, he claimed that he will collect all the places from 11 to 5454 after two more rated contest
阅读全文
摘要:题目描述 Farmer John has installed a new system of N−1N-1N−1 pipes to transport milk between the NNN stalls in his barn (2≤N≤50,0002 \leq N \leq 50,0002≤N
阅读全文
摘要:Yixght is a manager of the company called SzqNetwork(SN). Now she's very worried because she has just received a bad news which denotes that DxtNetwor
阅读全文
摘要: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 program will read
阅读全文
摘要:Word ss of length nn is called kk -complete if ss is a palindrome, i.e. si=sn+1−isi=sn+1−i for all 1≤i≤n1≤i≤n ; ss has a period of kk , i.e. si=sk+isi
阅读全文
摘要:A positive integer is called composite if it can be represented as a product of two positive integers, both greater than 11 . For example, the followi
阅读全文
摘要:Alice has a cute cat. To keep her cat fit, Alice wants to design an exercising walk for her cat! Initially, Alice's cat is located in a cell (x,y)(x,y
阅读全文
摘要:You are given a rooted tree consisting of nn vertices numbered from 11 to nn . The root of the tree is a vertex number 11 . A tree is a connected undi
阅读全文
摘要:题目描述 Farmer John 计划建造 NNN 个农场,用 N−1N-1N−1 条道路连接,构成一棵树(也就是说,所有农场之间都互相可以到达,并且没有环)。每个农场有一头奶牛,品种为更赛牛或荷斯坦牛之一。 Farmer John 的 MMM 个朋友经常前来拜访他。在朋友 iii 拜访之时,Far
阅读全文
摘要:There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want
阅读全文