Submission #198249

#TimeUsernameProblemLanguageResultExecution timeMemory
198249AMO5Strange Device (APIO19_strange_device)C++98
0 / 100
5051 ms524292 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair < ll ,ll> pll; ll n,a,b; map < ll , ll >vis; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> a >> b; ll le,ri, ans = 0; ll pdt = a*b; for(ll i = 0; i < n; i++){ cin >> le >> ri; for(ll j = le; j <= ri; j++){ ll cur = j%pdt; if(!vis[cur]){ ans++; } vis[cur]++; } } cout << ans << 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...