Submission #98519

#TimeUsernameProblemLanguageResultExecution timeMemory
98519pamajZoltan (COCI16_zoltan)C++14
14 / 140
537 ms23604 KiB
#include <bits/stdc++.h> using namespace std; #define int int64_t const int mod = 1e9 + 7; int v[200010]; int n; map<int, int> mp; set<int> st; int exp(int x, int y, int p) { int res = 1; x = x % p; while (y > 0) { if (y & 1) res = (res*x) % p; y = y>>1; x = (x*x) % p; } return res; } int32_t main() { cin >> n; for(int i = 0; i < n; i++) { cin >> v[i]; mp[v[i]]++; st.insert(v[i]); } long long ans = 1; for(auto u : st) { if(mp[u] == 1) continue; ans *= exp(2, mp[u], mod); ans %= mod; } cout << st.size() << " " << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...