本地通过洛谷10分
查看原帖
本地通过洛谷10分
746237
SaintRelief楼主2024/8/23 11:15
#include<bits/stdc++.h>
const int N=1e6+10,INF=0x3f3f3f3f;
namespace qwq {
#define int long long
#define ll long long
#define debug(x) puts("--------"),cout<<#x<<'='<<x,puts("--------")
#define mymax(a,b) (a>b?a:b)
#define mymin(a,b) (a<b?a:b)
#define myabs(x) (x<0?-x:x)
#define fst ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define fu(i,l,r) for(int i=l;i<=r;i++)
#define fd(i,l,r) for(int i=r;i>=l;i--)
#define pii pair<int,int>
#define fi first
#define se second
#define il inline
#define MAXN (1<<20)
	static char in[MAXN],out[MAXN];
	char *p1=in,*p2=in,*p3=out;
	il char gc() {
		if(p1==p2) {
			p1=in;
			p2=in+fread(in,1,MAXN,stdin);
			if(p1==p2)return EOF;
		}
		return *p1++;
	}
	il void flush() {
		fwrite(out,1,p3-out,stdout);
		p3=out;
	}
	il void pc(char ch) {
		if(p3==(out+(MAXN)))flush();
		*p3++=ch;
	}
	class Flush {
		public:
			~Flush() {
				fwrite(out,1,p3-out,stdout);
				p3=out;
			}
	} _;
	template<typename T>il void read(T &x) {
		x=0;
		bool f=1;
		char ch=gc();
		for(; !isdigit(ch); ch=gc())if(ch=='-')f=0;
		for(; isdigit(ch); ch=gc())x=x*10+ch-'0';
		x=(f==0?-x:x);
	}
	template<typename T>il void write(T a,char t='\0') {
		if(a<0)pc('-'),a=-a;
		if(a==0)pc('0');
		char ch[MAXN];
		int x=a,tot=0;
		for(; x; x/=10)ch[++tot]=(x%10)^'0';
		for(; tot; tot--)pc(ch[tot]);
		if(t!='\0')pc(t);
	}
	il void read(std::string &s) {
		s="";
		char ch=gc();
		for(; ch=='\n'&&ch==' '&&ch=='\r'&&ch!=EOF; ch=gc());
		for(; ch!='\n'&&ch!=' '&&ch!='\r'&&ch!=EOF; ch=gc())s+=ch;
	}
	il void write(std::string s) {
		for(int i=0; s[i]!='\0'; i++)pc(s[i]);
	}
} using namespace qwq;
using namespace std;

int n;
string s;
set<string> st;

void solve() {
	read(n);// 改cin就可以过
	for (int i = 1; i <= n; i++) {
		read(s);// 改cin就可以过
		st.insert(s);
	}
	write(st.size());
	return ;
}

signed main() {
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int T = 1;
	//cin>>T;
	while (T--) {
		solve();
	}
	return 0;
}
2024/8/23 11:15
加载中...