Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <set>
  4. #include <algorithm>
  5. #include <chrono>
  6. #include <cassert>
  7. #include <cstdlib>
  8. #include <math.h>
  9. #include <map>
  10.  
  11. using namespace std;
  12.  
  13. int main() {
  14. int n;
  15. int k = 34921;
  16. cin >> n;
  17. long long int a[k];
  18. for (int i = 0; i < k; ++i) {
  19. a[i] = 0;
  20. }
  21. for (int i = 0; i < n; ++i) {
  22. int num, t;
  23. cin >> num >> t;
  24. a[num % k] += t;
  25. }
  26. int num;
  27. cin >> num;
  28. cout << a[num % k];
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement