Submission #972899

#TimeUsernameProblemLanguageResultExecution timeMemory
972899UnforgettableplStrange Device (APIO19_strange_device)C++17
0 / 100
5028 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; if((B+1)%A==0){ modulus = B; } else { modulus = __int128(A)*__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...