Submission #260010

#TimeUsernameProblemLanguageResultExecution timeMemory
260010s_avila_gStrange Device (APIO19_strange_device)C++14
10 / 100
5095 ms524292 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define ff first #define ss second map<pair<ll,ll>, ll> mp; int main(){ ll n,a,b,x1,y1; cin>>n>>a>>b; for(int i = 0; i < n; i++){ cin>>x1>>y1; for(ll i = x1; i <= y1; i++){ ll xi = (i + i/b) % a; ll yi = i % b; mp[make_pair(xi,yi)]++; } } cout<<mp.size()<<endl; }
#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...