fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4.  
  5. /*
  6.  * Think twice, code once
  7.  * Think of different approaches to tackle a problem: write them down.
  8.  * Think of different views of the problem. don't look from only one side.
  9.  * don't get stuck in one approach.
  10.  * common mistakes: - over_flow
  11.  * - out_of_bound index
  12.  * - infinite loop
  13.  * - corner cases
  14.  * - duplication counting.
  15. */
  16.  
  17. vector<ll> getRepresentation(ll num, ll base)
  18. {
  19. vector<ll> ans;
  20. while (num)
  21. {
  22. ans.push_back(num%base);
  23. num /= base;
  24. }
  25. reverse(ans.begin(), ans.end());
  26. return ans;
  27. }
  28.  
  29. bool isPowerOfTwo(long long num)
  30. {
  31. return __builtin_popcountll(num) == 1;
  32. }
  33.  
  34. bool checkBit (long long num, long long bit)
  35. {
  36. return ((num >> bit) & 1);
  37. }
  38.  
  39. long long toggleBit (long long num, long long bit)
  40. {
  41. return (num ^ (1LL << bit));
  42. }
  43.  
  44. long long setBit (long long num, long long bit)
  45. {
  46. return (num | (1LL << bit));
  47. }
  48.  
  49. long long clearBit (long long num, long long bit)
  50. {
  51. return (num & (~(1LL << bit)));
  52. }
  53.  
  54.  
  55. void solve()
  56. {
  57.  
  58. }
  59.  
  60. int main()
  61. {
  62. #ifndef ONLINE_JUDGE
  63. freopen("input.txt", "r", stdin);
  64. freopen("output.txt", "w", stdout);
  65. freopen("Errors.txt", "w", stderr);
  66. #endif
  67. ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  68. int t = 1;
  69. // cin >> t;
  70. while (t--)
  71. {
  72. solve();
  73. if (t) cout << '\n';
  74. }
  75. cout << '\n';
  76. return 0;
  77. }
Success #stdin #stdout 0s 5300KB
stdin
Standard input is empty
stdout