Submission #1044580

#TimeUsernameProblemLanguageResultExecution timeMemory
1044580vjudge1Strange Device (APIO19_strange_device)C++17
0 / 100
1966 ms524288 KiB
#include <bits/stdc++.h> using std::cin, std::cout, std::vector, std::set, std::endl, std::string, std::map,std::pair; #ifdef LOCAL #define file freopen("in.txt","r",stdin);freopen("out.txt","w",stdout); #else #define file ;; #endif #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; template <typename T> using Tree = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>; #include <random> int main(){ file; int n,A,B; cin >> n >> A >> B; vector<int> l(n),r(n); set<pair<int,int>> s; for(int i=0;i<n;i++){ cin >> l[i] >> r[i]; for(int t=l[i];t<=r[i];t++){ s.insert({(t+t/B)%A,t%B}); } } cout << s.size() << endl; return 0; }
#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...