原文链接:https://www.dreamwings.cn/hdu5688/2650.html Problem D Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 247    Accepted Submission(s): 174 Problem Description 度熊所居住的 D 国,是一个完全尊重人权的国度.以至于这个国家…
原文链接:https://www.dreamwings.cn/hdu5686/2645.html Problem B Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 403    Accepted Submission(s): 136 Problem Description   度熊面前有一个全是由1构成的字符串,被称为全1序列.你可以…
原文链接:https://www.dreamwings.cn/hdu5685/2637.html Problem A Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 504    Accepted Submission(s): 195 Problem Description 度熊手上有一本字典存储了大量的单词,有一次,他把所有单词组成了…
看题:http://bestcoder.hdu.edu.cn/contests/contest_show.php?cid=690 交题:http://acm.hdu.edu.cn/search.php?field=problem&key=2016%22%B0%D9%B6%C8%D6%AE%D0%C7%22+-+%D7%CA%B8%F1%C8%FC%A3%A8Astar+Round1%A3%A9&source=1&searchmode=source Solved Pro.ID Tit…
简单模拟题,耐心写就能过. #include <stdio.h> #include <math.h> #include<cstring> #include<cmath> #include<map> #include<string> #include<algorithm> #include<vector> using namespace std; ; int n; struct X { ]; ],R[]; } h…
字典树. 插入的时候update一下节点出现的次数. delete的时候,先把前缀之后的全删了.然后看前缀最后一个节点出现了几次,然后前缀上每个节点的次数都减去这个次数. 前缀从上到下再检查一遍,如果出现了次数为0的节点,也删去. #include <stdio.h> #include <math.h> #include<cstring> #include<cmath> #include<map> #include<string> #…
排个序,map直接搞. #include <stdio.h> #include <math.h> #include<cstring> #include<cmath> #include<map> #include<string> #include<algorithm> using namespace std; int main() { int n; while(~scanf("%d",&n)) {…
规律题,斐波那契数列,数据有毒,0的时候输出换行.会爆longlong,写个大数模板或者Java搞. import java.io.BufferedInputStream; import java.math.BigInteger; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner (new BufferedInputStre…
保存前缀乘,询问的时候输出c[ri]/c[li-1]即可,因为是除法,所以计算一下c[li-1]的逆元. #include <stdio.h> #include <math.h> #include<cstring> #include<cmath> #include<map> #include<string> #include<algorithm> using namespace std; ; +]; +]; long lo…
逆元 1001 Problem A 求前缀哈希和逆元 #include <bits/stdc++.h> typedef long long ll; const int MOD = 9973; const int N = 1e5 + 5; int inv[MOD+5]; int ha[N]; char str[N]; int n; void Inv(int n, int p) { inv[1] = 1; for (int i=2; i<=n; ++i) { inv[i] = (ll) (p…