逆天!2*AC,6*RE,6*TLE,6*WA
查看原帖
逆天!2*AC,6*RE,6*TLE,6*WA
1243618
Jokersheng楼主2024/11/10 12:07

好奇自己怎么写出来的

#include <bits/stdc++.h>
using namespace std;
int f[100010],t,n,x,p;
int main(){
	cin>>t;
	while(t--){	
		cin>>n;
		for(int i=1;i<=n;i++){
			cin>>x;
			f[x]++;
			if(f[x]==1)p++;
		}
		cout<<p<<endl;
	}
	return 0;
}
2024/11/10 12:07
加载中...