Submission #979811

#TimeUsernameProblemLanguageResultExecution timeMemory
979811kaynStrange Device (APIO19_strange_device)C++14
0 / 100
5078 ms524288 KiB
#include<bits/stdc++.h> #define ll long long #define pb push_back #define fi first #define se second #define pii pair<int, int> #define pll pair<ll, ll> #define run ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; ll n, a, b, l, r, ans; int main(){ cin >> n >> a >> b; ll kpk=a*b/__gcd(a, b); set<pii> s; for(int i=1; i<=n; i++){ cin >> l >> r; for(int t=l; t<=r; t++){ s.insert({(t+t/b)%a, t%b}); } } cout << s.size() << endl; return 0; }

Compilation message (stderr)

strange_device.cpp: In function 'int main()':
strange_device.cpp:14:5: warning: unused variable 'kpk' [-Wunused-variable]
   14 |  ll kpk=a*b/__gcd(a, b);
      |     ^~~
#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...