SHARE
TWEET

Untitled

lalalalalalalaalalla Oct 10th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <vector>
  3. #include <string>
  4. #include <iomanip>
  5. #include <queue>
  6. #include <cmath>
  7. #include <algorithm>
  8. #include <tuple>
  9. #include <iomanip>
  10. #include <stdio.h>
  11. #include <numeric>
  12. #include <map>
  13. #include <bitset>
  14. #include <set>
  15. #include <stack>
  16. #include <queue>
  17. #include <unordered_set>
  18. #include <cassert>
  19.  
  20.  
  21. //#pragma GCC optimize("Ofast,no-stack-protector")
  22. //#pragma GCC optimize("O3")
  23. //#pragma GCC target("avx2")
  24. //#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
  25. //#pragma GCC optimize("unroll-loops")
  26. //#pragma GCC optimize("fast-math")
  27. //#pragma GCC optimize("section-anchors")
  28. //#pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
  29. //#pragma GCC optimize("vpt")
  30. //#pragma GCC optimize("rename-registers")
  31. //#pragma GCC optimize("move-loop-invariants")
  32. //#pragma GCC optimize("unswitch-loops")
  33. //#pragma GCC optimize("function-sections")
  34. //#pragma GCC optimize("data-sections")
  35. //#pragma GCC optimize("branch-target-load-optimize")
  36. //#pragma GCC optimize("branch-target-load-optimize2")
  37. //#pragma GCC optimize("btr-bb-exclusive")
  38. //#pragma GCC optimize("O0")
  39.  
  40.  
  41. #define int long long
  42. #define ll long long
  43. #define ull unsigned long long
  44. #define all(a) a.begin(), a.end()
  45. #define pii pair<int, int>
  46. #define pb push_back
  47. #define ld long double
  48.  
  49.  
  50. using namespace std;
  51.  
  52. //const int INF = 1e13;
  53. //const int mod = 2600000069;
  54. //const int p = 179;
  55.  
  56. const int n = 15485864;
  57.  
  58. vector<bool> a(n, 1);
  59.  
  60. signed main() {
  61.     ios_base::sync_with_stdio(0);
  62.     cin.tie(0);
  63.     cout.tie(0);
  64.     int k;
  65.     cin >> k;
  66.     for (int i = 2; i < n; i++) {
  67.         if (a[i]) {
  68.             for (int j = i * i; j < n; j += i) {
  69.                 a[j] = 0;
  70.             }
  71.         }
  72.     }
  73.     for (int i = 2; i < n; i++) {
  74.         k -= a[i];
  75.         if (k == 0) {
  76.             cout << i << "\n";
  77.             return 0;
  78.         }
  79.     }
  80. }
  81. /*
  82. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top