大数 #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> #include<queue> using namespace std; int a[2000]; int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n)…
传送门 双倍经验(弱化版本) 考虑求出来heightheightheight数组之后用增量法. 也就是考虑每增加一个heightheightheight对答案产生的贡献. 算出来是∑∣S∣−heighti+1−sai\sum|S|-height_i+1-sa_i∑∣S∣−heighti+1−sai 代码: #include<bits/stdc++.h> #define ri register int using namespace std; const int N=5e4+5; int n…
694. Distinct Substrings Problem code: DISUBSTR Given a string, we need to find the total number of its distinct substrings. Input T- number of test cases. T<=20;Each test case consists of one string, whose length is <= 1000 Output For each test c…
Introduction Log files are files that contain messages about the system, including the kernel, services, and applications running on it. There are different log files for different information. For example, there is a default system log file, a log f…