南京网络赛C】的更多相关文章

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…
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…
2018ICPC南京网络赛 A. An Olympian Math Problem 题目描述:求\(\sum_{i=1}^{n} i\times i! \%n\) solution \[(n-1) \times (n-1)! \% n= (n-2)!(n^2-2n+1) \%n =(n-2)!\] \[(n-2+1)\times (n-2)! \% n= (n-3)!(n^2-3n+2) \%n =(n-3)! \times 2\] 以此类推,最终只剩下\(n-1\) 时间复杂度:\(O(1)\…
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…
南京网络赛自闭现场 https://nanti.jisuanke.com/t/41298 二维偏序经典题型 二维前缀和!!! #include<bits/stdc++.h> using namespace std; #define int long long #define sc(x) scanf("%lld",&x); int T; #define P pair<int,int> #define fi first #define se second #…
题目链接 题意 : 给出一个由数字组成的字符串.然后要你找出其所有本质不同的回文子串.然后将这些回文子串转化为整数后相加.问你最后的结果是多少.答案模 1e9+7 分析 : 应该可以算是回文树挺裸的题目吧 可惜网络赛的时候不会啊.看着马拉车想半天.卒... 对于每一个节点.记录其转化为整数之后的值 然后在回文串插入字符的时候 不断维护这个信息就行了 其实很好理解.看一下代码就懂了 ( 如果你学过回文树的话... ) 就是多加了变量 val .维护语句 #include<bits/stdc++.h…
30.43% 2000ms 262144K Feeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 3030 Yuan). However, his owner CXY thinks that take-away food is unhealthy and expensive. So she demands her hamster to fulfill a m…
样例输入复制 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个:这是直接算的一种方法:如何程序表示…
During tea-drinking, princess, amongst other things, asked why has such a good-natured and cute Dragon imprisoned Lpl in the Castle? Dragon smiled enigmatically and answered that it is a big secret. After a pause, Dragon added: - We have a contract.…