Submission #440334

#TimeUsernameProblemLanguageResultExecution timeMemory
440334den_tarStrange Device (APIO19_strange_device)C++14
10 / 100
5065 ms524292 KiB
#include <bits/stdc++.h> using namespace std; #define fast ios_base::sync_with_stdio();cin.tie();cout.tie(); #define en cout<<endl; #define ops cout<<"ops"<<endl; #define line cout<<"---------------------------"<<endl; #define fi first #define se second typedef long long ll; typedef long double ld; typedef pair<ll,ll> pllll; typedef string str; const ll DIM = 6e4 + 7; const ll DIMM = 1e2 + 7; const ll DDIM = 7; const ll INF = 1e18 + 7; const ll X = 1e5 + 7; const ll BS = 2e5 + 7; const ll AS = 26 + 7; const ll MODULO = 1e9 + 7; ll nt,n,m,k,q; ll val,val1; ll A,B; ll l,r; ll x,y,t; set<pllll> s; int main() { fast; //ll x1,y1,x2,y2; cin>>n>>A>>B; for(int i=1;i<=n;i++){ cin>>l>>r; for(ll i=l;i<=r;i++){ y=i%B; x=(i+i/B)%A; s.insert({x,y}); } } 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...