| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 98518 | pamaj | Zoltan (COCI16_zoltan) | C++14 | 640 ms | 23668 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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)
{
ans *= exp(2, mp[u], mod);
ans %= mod;
}
cout << st.size() << " " << ans << "\n";
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
