Submission #972895

#TimeUsernameProblemLanguageResultExecution timeMemory
972895UnforgettableplStrange Device (APIO19_strange_device)C++17
0 / 100
0 ms600 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; return 1; } else { modulus = A*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...