摘要:#include<iostream> #include<cstring> //用trlen using namespace std; const int N = 1e6 + 10; char s[N], p[N]; //s为匹配串,p为模板串 int ne[N]; //记录p的next数组 int
阅读全文
摘要:给出正整数n和k,计算j(n,k)=k mod 1 + k mod 2 + k mod 3 +⋯+ k mod n的值。其中 k mod i表示k除以i的余数。 例如j(5,3)=3 mod 1 + 3 mod 2 + 3 mod 3 + 3 mod 4 + 3 mod 5 = 0 + 1 + 0
阅读全文
摘要:Board Game 时间限制: 1.000 Sec 内存限制: 128 MB 题目描述 Spend more time at home these days, you’ve decided to invent a board game, so, of course, you don’t get b
阅读全文
摘要:题目 You are given integers N and K. Find the number of triples (a,b,c) of positive integers not greater than N such that a+b,b+c and c+a are all multip
阅读全文
摘要:Hello World #include<bits/stdc++.h> /* 判断一个字符串是否是回文串,是否是镜像串 */ using namespace std; const char* rev = "A 3 HIL JM O 2TUVWXY51SE Z 8";//空格,为了确定相应位置 con
阅读全文