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>
#pragma warning(disable : 4996)
#pragma warning(disable : 6031)
#define USACO freopen("casting.in", "r", stdin); freopen("casting.out", "w+", stdout)
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define ll long long
using namespace std;
ll binpow(ll a, ll x, ll m) {
ll ans = 1, md = a % m;
while (x != 0) {
if (x % 2 == 1) ans = (ans * md) % m;
md = (md * md) % m;
x >>= 1;
}
return ans;
}
ll gcd(ll a, ll b) {
return b == 0 ? a : gcd(b, a % b);
}
ll lcm(ll a, ll b) {
return a * b / gcd(a, b);
}
/*
*/
void solve() {
int n;
cin >> n;
set<int> s;
for (int i = 0; i < n; i++) {
int a, b;
cin >> a >> b;
s.insert(a);
}
cout << binpow(2, s.size(), 1e9 + 7) - 1 << "\n";
}
int main() {
//USACO;
fastIO;
solve();
}
Compilation message (stderr)
boat.cpp:2: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
2 | #pragma warning(disable : 4996)
|
boat.cpp:3: warning: ignoring '#pragma warning ' [-Wunknown-pragmas]
3 | #pragma warning(disable : 6031)
|
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |