From 727a49a9f7afde9a60835ae83050fc45d27f89ee Mon Sep 17 00:00:00 2001 From: tomarviii88 <43980170+tomarviii88@users.noreply.github.com> Date: Fri, 2 Oct 2020 14:34:08 +0530 Subject: [PATCH] solution to TREE2 codechef --- TREE2.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 TREE2.cpp diff --git a/TREE2.cpp b/TREE2.cpp new file mode 100644 index 0000000..a3c0d6b --- /dev/null +++ b/TREE2.cpp @@ -0,0 +1,31 @@ +#include +using namespace std; + +#define ll long long +#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); +#define ve vector +#define vl vector +#define pb push_back +#define fo(i,a,n) for(i=a;i>t; + while(t--) + { + ll n; + cin>>n; + vl v(n); + ll i; + fo(i,0,n) cin>>v[i]; + set > s1; + fo(i,0,n) { + if(v[i]!=0) + s1.insert(v[i]); + } + + + cout<<(s1.size())<