Submission #983438

#TimeUsernameProblemLanguageResultExecution timeMemory
983438elitewantsyouStrange Device (APIO19_strange_device)C++14
0 / 100
5088 ms524288 KiB
#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); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...