Only Premium Users can view the Question
hey I also want to apply for the same, which Oa is this and where to apply pls share
solution
void solve() { int n; cin>>n; set<int> s; f(i,n) { int x; cin>>x; s.insert(x); } int sz=s.size(); int ans=0; for(int i=0;i<=n;i++) { ans+=(n-i)*min(i+1,sz); } cout<<ans<<endl; } int main() { solve(); }
Login before adding your answer.
hey I also want to apply for the same, which Oa is this and where to apply pls share