#pragma GCC optimize("Ofast")
#define Magic ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define tsts int tststs; cin >> tststs; while(tststs--)
#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
using str = string;
#define sz(a) int(a.size())
#define ppf pop_front
#define ppb pop_back
#define pf push_front
#define pb push_back
#define x1 fukumean1
#define x2 fukumean2
#define y1 fukumean3
#define y2 fukumean4
#define ers erase
#define nxt print() // for new line
#define fix cout << fixed // for decimal numbers
struct custom_hash {
static uint64_t splitmix64(uint64_t x) {
// http://xorshift.di.unimi.it/splitmix64.c
x += 0x9e3779b97f4a7c15;
x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
return x ^ (x >> 31);
}
size_t operator()(uint64_t x) const {
static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
return splitmix64(x + FIXED_RANDOM);
}
};
void print() {cout << "\n";}
template <typename T>
void print(const T& arg) {
cout << arg << " ";
}
template <typename T, typename... Args>
void print(const T& arg, const Args&... args) {
cout << arg << " ";
print(args...);
}
inline void debugMode() {
#ifndef ONLINE_JUDGE
freopen("in.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#endif // ONLINE_JUDGE
}
signed main() {
Magic
// debugMode();
long long n, A, B;
cin >> n >> A >> B;
map<pair<long long, long long>, int> c;
for (int i = 1; i <= n; i++) {
long long l, r;
cin >> l >> r;
for (int j = l; j <= r; j++) {
c[{(j + (j / B)) % A, j % B}]++;
}
}
cout << sz(c);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
5088 ms |
405160 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Runtime error |
2607 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Execution timed out |
5087 ms |
60748 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
5069 ms |
77640 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
5069 ms |
77640 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
5069 ms |
77640 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Runtime error |
1143 ms |
524288 KB |
Execution killed with signal 9 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Execution timed out |
5088 ms |
405160 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |