#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";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
2 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
3 |
Incorrect |
2 ms |
256 KB |
Output isn't correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
2 ms |
384 KB |
Output is correct |
6 |
Incorrect |
3 ms |
256 KB |
Output isn't correct |
7 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
8 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
9 |
Incorrect |
4 ms |
512 KB |
Output isn't correct |
10 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
11 |
Incorrect |
219 ms |
15836 KB |
Output isn't correct |
12 |
Incorrect |
175 ms |
13816 KB |
Output isn't correct |
13 |
Incorrect |
174 ms |
13048 KB |
Output isn't correct |
14 |
Incorrect |
263 ms |
13816 KB |
Output isn't correct |
15 |
Incorrect |
328 ms |
17184 KB |
Output isn't correct |
16 |
Incorrect |
427 ms |
19900 KB |
Output isn't correct |
17 |
Incorrect |
241 ms |
16888 KB |
Output isn't correct |
18 |
Incorrect |
228 ms |
16976 KB |
Output isn't correct |
19 |
Incorrect |
207 ms |
16888 KB |
Output isn't correct |
20 |
Incorrect |
232 ms |
16852 KB |
Output isn't correct |