2022春每日一题:Day 30


题目:[JSOI2009]电子字典

读完题后,暴力?确实,计算一下时间复杂度最坏情况下,20263*10000=1.5e8,卡一下常可以直接卡到7e7,最严格来说应该卡的过去,但是此题数据可以直接卡过。

代码:

#include 
#include 
#include 
#include 
const int N=2e5+5;
using namespace std;
int n,m,len,tot,vis[N];
namespace trietree
{
	struct trie
	{
		int son[26],tag;
	}e[N];
	void insert(char s[])
	{
		int p=0,len=strlen(s);
		for(int i=0;i