随笔分类 - Atcoder/洛谷/namomo OJ
摘要:P3157 [CQOI2011]动态逆序对 题目描述 对于序列A,它的逆序对数定义为满足iAj的数对(i,j)的个数。给1到n的一个排列,按照某种顺序依次删除m个元素,你的任务是在每次删除一个元素之前统计整个序列的逆序对数。 输入格式 输入第一行包含两个整数n和m,即初始元素的个数和删除的元素个数。
阅读全文
摘要:P2163 [SHOI2007]园丁的烦恼 题目描述 很久很久以前,在遥远的大陆上有一个美丽的国家。统治着这个美丽国家的国王是一个园艺爱好者,在他的皇家花园里种植着各种奇花异草。 有一天国王漫步在花园里,若有所思,他问一个园丁道: “最近我在思索一个问题,如果我们把花坛摆成六个六角形,那么……” “
阅读全文
摘要:P3469 [POI2008]BLO Blockade https://www.luogu.org/problem/P3469 题目描述 There are exactly n n towns in Byteotia. Some towns are connected by bidirectiona
阅读全文
摘要:P2746 [USACO5.3]校园网Network of Schools https://www.luogu.org/problem/P2746 题目描述 一些学校连入一个电脑网络。那些学校已订立了协议:每个学校都会给其它的一些学校分发软件(称作“接受学校”)。注意即使 B 在 A 学校的分发列表
阅读全文
摘要:P2341 [HAOI2006]受欢迎的牛|【模板】强连通分量 https://www.luogu.org/problem/P2341 题目描述 每头奶牛都梦想成为牛棚里的明星。被所有奶牛喜欢的奶牛就是一头明星奶牛。所有奶 牛都是自恋狂,每头奶牛总是喜欢自己的。奶牛之间的“喜欢”是可以传递的——如果
阅读全文
摘要:题目描述 如题,已知一棵包含N个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作: 操作1: 格式: 1 x y z 表示将树从x到y结点最短路径上所有节点的值都加上z 操作2: 格式: 2 x y 表示求树从x到y结点最短路径上所有节点的值之和 操作3: 格式: 3 x z 表示将
阅读全文
摘要:题目描述 给定一个 NN 个点,MM 条有向边的带非负权图,请你计算从 SS 出发,到每个点的距离。 数据保证你能从 SS 出发到任意点。 输入格式 第一行为三个正整数 N, M, SN,M,S。 第二行起 MM 行,每行三个非负整数 u_i, v_i, w_iu i ,v i ,w i
阅读全文
摘要:链接:https://ac.nowcoder.com/acm/contest/984/A 来源:牛客网 题目描述 Some of Farmer John's N cows (1 ≤ N ≤ 80,000) are having a bad hair day! Since each cow is se
阅读全文
摘要:题目描述 司令部的将军们打算在N M的网格地图上部署他们的炮兵部队。一个N M的地图由N行M列组成,地图的每一格可能是山地(用“H” 表示),也可能是平原(用“P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示
阅读全文
摘要:题目描述 在N×N的棋盘里面放K个国王,使他们互不攻击,共有多少种摆放方案。国王能攻击到它上下左右,以及左上左下右上右下八个方向上附近的各一个格子,共8个格子。 注:数据有加强(2018/4/25) 输入输出格式 输入格式: 只有一行,包含两个数N,K ( 1 题意: 思路: 动态规划, 定义状态d
阅读全文
摘要:题目描述 Farmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy
阅读全文
摘要:Problem Statement There is an integer sequence A of length N. Find the number of the pairs of integers l and r (1≤l≤r≤N) that satisfy the following co
阅读全文
摘要:Problem Statement You are given two integer sequences, each of length N: a1,…,aN and b1,…,bN. There are N2 ways to choose two integers i and j such th
阅读全文
摘要:Problem Statement On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (ai,bi), and the coo
阅读全文
摘要:Time limit : 2sec / Memory limit : 256MB Score : 900 points Problem Statement Joisino has a formula consisting of N terms: A1 op1 A2 … opN−1 AN. Here,
阅读全文
摘要:Problem Statement This is an interactive task. Snuke has a favorite positive integer, N. You can ask him the following type of question at most 64 tim
阅读全文
摘要:Time Limit: 2 sec / Memory Limit: 1024 MB Score : 700700 points Problem Statement You are given an integer NN. Build an undirected graph with NN verti
阅读全文
摘要:Time Limit: 2 sec / Memory Limit: 1024 MB Score : 400400 points Problem Statement Snuke has an empty sequence aa. He will perform NN operations on thi
阅读全文
摘要:Problem Statement Tak has N cards. On the i-th (1≤i≤N) card is written an integer xi. He is selecting one or more cards from these N cards, so that th
阅读全文
摘要:Problem Statement AtCoDeer the deer is seeing a quick report of election results on TV. Two candidates are standing for the election: Takahashi and Ao
阅读全文

浙公网安备 33010602011771号