全WA
查看原帖
全WA
945851
ccch1ennn楼主2024/7/21 21:10
#include<bits/stdc++.h>
using namespace std;
const int N=32010;
int t[N*4][30],tot=0;

void plant(string s)
{
	int root=0,len=s.size();
	for(int i=0;i<len;i++)
	{
		int h=s[i]-'A';
		if(!t[root][h])
		{
			tot++;
			t[root][h]=tot;
		}
		root=t[root][h];
	}
}

int main()
{
	string sread;
	while(getline(cin,sread))
	{
		plant(sread);
	}
	cout<<tot+1;
	return 0;
}

额,到底哪里错了a

2024/7/21 21:10
加载中...