What is time limit per test 2 seconds?
My understanding:
Means 10^16 operations allowed ??? because time limit 1sec allows 10^8 operations .
Please clarify my doubt … and correct me if I am wrong.
What is time limit per test 2 seconds?
My understanding:
Means 10^16 operations allowed ??? because time limit 1sec allows 10^8 operations .
Please clarify my doubt … and correct me if I am wrong.
2 sec allows approximately 2*10^8 operations
Thanks bro!!!
what is the time complexity of this code, help me.
#include<bits/stdc++.h>
using namespace std;
int32_t main(){
int n,m; scanf("%d",&n);
vector<int> vs(n);
for(auto &t : vs)scanf("%d",&t);
scanf("%d",&m);
vector<int> va(m);
for(auto &t : va)scanf("%d",&t);
set<int,greater<int>> st;
for(int i=0;i<n;i++){
> st.emplace(vs[i]);
}
for(int i=0;i<m;i++){
st.emplace(va[i]);
auto it=st.find(va[i]);
int pos=distance(st.begin(),it)+1;
printf("%d\n",pos);
}
return 0;
}
printf("%ld\n",pos);
}
return 0;
}