题目链接:https://nanti.jisuanke.com/t/31001 解题心得: 一个BZOJ的原题,之前就写过博客了. 原题地址:https://www.lydsy.com/JudgeOnline/problem.php?id=2763 原题博客:https://www.cnblogs.com/GoldenFingers/p/9574230.html 比赛的时候遇到这个题第一个反应就是原题,然后用了以前的代码,WA:单向边,以前代码上是双向边.TLE:这个题出题人还卡了一下网格图.…
类似题解 There are NN cities in the country, and MM directional roads from uu to v(1\le u, v\le n)v(1≤u,v≤n). Every road has a distance c_ici​. Haze is a Magical Girl that lives in City 11, she can choose no more than KK roads and make their distances be…
2019ICPC南京网络赛A题 The beautiful values of the palace https://nanti.jisuanke.com/t/41298 Here is a square matrix of n * nn∗n, each lattice has its value (nn must be odd), and the center value is n * nn∗n. Its spiral decline along the center of the squar…
Walk Through Squares Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 200    Accepted Submission(s): 57 Problem Description   On the beaming day of 60th anniversary of NJUST, as a military colleg…
Divide Groups Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 423    Accepted Submission(s): 161 Problem Description   This year is the 60th anniversary of NJUST, and to make the celebration mor…
Count The Pairs Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 277    Accepted Submission(s): 150 Problem Description   With the 60th anniversary celebration of Nanjing University of Science…
样例输入复制 2 3 3 0 3 3 1 2 2 样例输出复制 Case #1: 36 Case #2: 20 题目来源 ACM-ICPC 2018 南京赛区网络预赛 题意: 就是求图中去掉涂黑的方格后还剩多少长方形 解析: 这个讲的非常好了 https://blog.csdn.net/Sirius_han/article/details/82313029 对于一个长为L, 高为H的无黑点矩阵中包含的高为H的子矩阵个数为L+(L-1)+(L-2)+...+1个:这是直接算的一种方法:如何程序表示…
题目顺序:A C E G I J L A. An Olympian Math Problem 打表,找规律,发现答案为n-1 C. GDY 题意: m张卡片,标号1-13: n个玩家,标号1-n:每个人拿前5个卡片 玩家1先出牌(最小),其他玩家2-n顺时针标号从1-n-1出牌 轮到当前玩家出牌,如果有比上一次的出牌大1,可以直接出:没有大1的牌,若有2出2:若都没有,这一轮跳过他 如果一轮中,玩家x出了一张最大的牌,玩家x~n,1~x中所有玩家都没有出牌,从玩家x开始所有玩家都拿一张牌(如 果…
题目链接 题意 : 给出一个由数字组成的字符串.然后要你找出其所有本质不同的回文子串.然后将这些回文子串转化为整数后相加.问你最后的结果是多少.答案模 1e9+7 分析 : 应该可以算是回文树挺裸的题目吧 可惜网络赛的时候不会啊.看着马拉车想半天.卒... 对于每一个节点.记录其转化为整数之后的值 然后在回文串插入字符的时候 不断维护这个信息就行了 其实很好理解.看一下代码就懂了 ( 如果你学过回文树的话... ) 就是多加了变量 val .维护语句 #include<bits/stdc++.h…
大致题意: 给定一个n个点m条边的图,在可以把路径上至多k条边的权值变为0的情况下,求S到T的最短路. 数据规模: N≤100000,M≤200000,K≤10 建一个立体的图,有k层,每一层是一份原图,消耗一次把一条边权值变为0的机会 = 在立体图中升一层 然后跑堆优化dij就好了,会卡spfa. AC代码: #include<cstdio> #include<queue> #include<cstring> #define rep(i,a,b) for(int i=…