Submission #974323

#TimeUsernameProblemLanguageResultExecution timeMemory
974323UnforgettableplStrange Device (APIO19_strange_device)C++17
10 / 100
5104 ms524288 KiB
#include <bits/stdc++.h> using namespace std; #define int long long int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int n,A,B; cin >> n >> A >> B; __int128 modulus = __int128(A/gcd(A,B+1))*__int128(B); set<__int128> answers; for(int i=1;i<=n;i++){ int l,r;cin>>l>>r; for(int x=l;x<=r;x++){ answers.insert(__int128(x)%modulus); } } cout << answers.size() << '\n'; }
#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...