CF1325B CopyCopyCopyCopyCopy 【思维】【map】

 题目意思就是经过无数次copy求最长上升子序列

总之就是他这一堆数中不同元素的个数

然后用一个map计数就好了

 1 #include <bits/stdc++.h>
 2 #define  int long long
 3 const int maxn=1e5+50;
 4 const int INF=0x3f3f3f3f;
 5 using namespace std;
 6 map<int,int>m;
 7 signed main(){
 8     int t;
 9     cin>>t;
10 while(t--){
11     m.clear();//每次用前map清空
12     int n;
13     cin>>n;
14  for(int i=0;i<n;i++){
15      int x;
16      cin>>x;
17      m[x]=1;//标记哦
18  }
19  cout<<m.size()<<'
';//输出map的大小
20 }
21 
22 return 0;
23 }
原文地址:https://www.cnblogs.com/ahijing/p/12888977.html