随笔分类 -  数据结构/线段树/树状数组

摘要:链接:https://ac.nowcoder.com/acm/contest/894/B?&headNav=acm 来源:牛客网 华华送奕奕小礼物 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题 阅读全文
posted @ 2019-08-13 00:07 茄子Min 阅读(189) 评论(1) 推荐(0)
摘要:After inventing Turing Tree, 3xian always felt boring when solving problems about intervals, because Turing Tree could easily have the solution. As we 阅读全文
posted @ 2019-08-06 21:07 茄子Min 阅读(273) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/904/E 来源:牛客网 DongDong数颜色 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描述 DongDo 阅读全文
posted @ 2019-08-06 19:51 茄子Min 阅读(258) 评论(0) 推荐(0)
摘要:wls 有三棵树,树上每个节点都有一个值 ai,现在有 2 种操作: 1. 将一条链上的所有节点的值开根号向下取整; 2. 求一条链上值的和; 链的定义是两点之间的最短路。 Input 第一行两个数 n, q 分别代表树上点的数量和操作数量。 第二行 n 个整数,第 i 个数代表第 i 个点的值 a 阅读全文
posted @ 2019-08-06 01:50 茄子Min 阅读(466) 评论(0) 推荐(0)
摘要:A lot of battleships of evil are arranged in a line before the battle. Our commander decides to use our secret weapon to eliminate the battleships. Ea 阅读全文
posted @ 2019-08-06 01:01 茄子Min 阅读(328) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/180/E 来源:牛客网 树上路径 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 给出一个n个点的树,1号节点 阅读全文
posted @ 2019-08-04 20:24 茄子Min 阅读(227) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/160/D 来源:牛客网 整数序列 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld 题目描述 给出一个长度为n的整数序列a 阅读全文
posted @ 2019-08-02 02:25 茄子Min 阅读(231) 评论(0) 推荐(0)
摘要:Summer again! Flynn is ready for another tour around. Since the tour would take three or more days, it is important to find a hotel that meets for a r 阅读全文
posted @ 2019-07-19 18:16 茄子Min 阅读(238) 评论(0) 推荐(0)
摘要:YaoYao has a company and he wants to employ m people recently. Since his company is so famous, there are n people coming for the interview. However, Y 阅读全文
posted @ 2019-07-19 16:41 茄子Min 阅读(332) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/881/A 来源:牛客网 Equivalent Prefixes 时间限制:C/C++ 2秒,其他语言4秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描 阅读全文
posted @ 2019-07-18 18:33 茄子Min 阅读(365) 评论(0) 推荐(0)
摘要:链接:https://ac.nowcoder.com/acm/contest/308/D 来源:牛客网 tokitsukaze and Inverse Number 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format 阅读全文
posted @ 2019-07-16 22:37 茄子Min 阅读(186) 评论(0) 推荐(0)
摘要:如果数组元素较大,需要离散化。 cpp include include include include include include include include include include include define ALL(x) (x).begin(), (x).end() defin 阅读全文
posted @ 2019-07-10 22:36 茄子Min 阅读(194) 评论(0) 推荐(0)
摘要:C. Python Indentation time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output In Python, code blocks 阅读全文
posted @ 2019-07-10 15:11 茄子Min 阅读(303) 评论(0) 推荐(0)
摘要:迫真小游戏 已经提交 已经通过 时间限制:2000ms 内存限制:256MB 73.98% 提交人数:196 通过人数:145 题目描述 H君喜欢在阳台晒太阳,闲暇之余他会玩一些塔防小游戏。 H君玩的小游戏可以抽象成一棵 nn 个节点的有根树,树以 11 为根,每个点的深度定义为其到根的简单路径上的 阅读全文
posted @ 2019-06-16 12:35 茄子Min 阅读(181) 评论(0) 推荐(0)
摘要:You are given two huge binary integer numbers aa and bb of lengths nn and mmrespectively. You will repeat the following process: if b>0b>0, then add t 阅读全文
posted @ 2019-05-02 16:47 茄子Min 阅读(267) 评论(0) 推荐(0)
摘要:There are nn players sitting at the card table. Each player has a favorite number. The favorite number of the jj-th player is fjfj. There are k⋅nk⋅n c 阅读全文
posted @ 2019-04-16 21:33 茄子Min 阅读(692) 评论(0) 推荐(0)
摘要:Bobo has a balanced parenthesis sequence P=p 1 p 2…p n of length n and q questions. The i-th question is whether P remains balanced after p ai and p b 阅读全文
posted @ 2019-04-10 21:41 茄子Min 阅读(255) 评论(0) 推荐(0)
摘要:Country of Metropolia is holding Olympiad of Metrpolises soon. It mean that all jury members of the olympiad should meet together in Metropolis (the c 阅读全文
posted @ 2019-04-06 00:10 茄子Min 阅读(328) 评论(0) 推荐(0)
摘要:Problem Statement There are N cities. There are also K roads and L railways, extending between the cities. The i-th road bidirectionally connects the  阅读全文
posted @ 2019-03-26 20:30 茄子Min 阅读(341) 评论(0) 推荐(1)
摘要:历届试题 小朋友排队 时间限制:1.0s 内存限制:256.0MB 问题描述 n 个小朋友站成一排。现在要把他们按身高从低到高的顺序排列,但是每次只能交换位置相邻的两个小朋友。 每个小朋友都有一个不高兴的程度。开始的时候,所有小朋友的不高兴程度都是0。 如果某个小朋友第一次被要求交换,则他的不高兴程 阅读全文
posted @ 2019-03-13 13:06 茄子Min 阅读(309) 评论(0) 推荐(0)