Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- set<ll> res;
- set<ll> factor(ll n){
- res.insert(n);
- for (ll i=1; i<=n; i++){
- if(n%i==0){
- res.insert(n/i);
- }
- }
- return res;
- }
- void solve(set<ll>& res){
- for (auto j:res){
- cout<<j<<" ";
- }
- cout<<"\n";
- res.clear();
- }
- ll countset(set<ll>& res){
- ll z=res.size();
- res.clear();
- return z;
- }
- int main()
- {
- int t;
- cin>>t;
- while(t--){
- ll n;
- cin>>n;
- factor(n);
- cout<<countset(res)<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement