# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
98515 | pamaj | Zoltan (COCI16_zoltan) | C++14 | 427 ms | 19900 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |