Submission #98515

#TimeUsernameProblemLanguageResultExecution timeMemory
98515pamajZoltan (COCI16_zoltan)C++14
14 / 140
427 ms19900 KiB
#include <bits/stdc++.h> using namespace std; int v[200010]; int n; map<int, int> mp; set<int> st; int main() { cin >> n; for(int i = 0; i < n; i++) { cin >> v[i]; mp[v[i]]++; st.insert(v[i]); } vector<int> p; for(int i = 0; i < n - 1; i++) { if(v[i] == v[i + 1]) { int cont = 1; while(v[i] == v[i + 1]) { cont++; i++; } p.push_back(cont); } } long long ans = 1; for(auto u : p) { ans *= pow(2, u); ans %= (1000000007); } cout << st.size() << " " << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...