Advertisement
ke_timofeeva7

С

May 26th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1.  
  2.  
  3. #include <iostream>
  4. #include <string>
  5. #include <sstream>
  6. #include <cmath>
  7. #include <memory.h>
  8. #include <algorithm>
  9. #include <stack>
  10. #include <deque>
  11. #include <iomanip>
  12. #include <stdio.h>
  13. #include <queue>
  14. #include <map>
  15. #include <set>
  16. #include <unordered_map>
  17. #include <unordered_set>
  18. #include <random>
  19. #include <ctime>
  20. #include <cstdlib>
  21. #include <cassert>
  22. #include <chrono>
  23. #include <array>
  24. #define int long long
  25. #define pii pair <int, int>
  26. #define pb push_back
  27. #define all(vc) vc.begin(), vc.end()
  28. #define fir first
  29. #define sec second
  30. #define endl "\n"
  31. #define un unsigned
  32. #define INF 1000000009
  33. #define double long double
  34. using namespace std;
  35.  
  36. const int N = 5000, R = 1 << 20, MOD = 1e9 + 7, ABC = 26, logn = 19;
  37.  
  38. mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
  39.  
  40. signed main()
  41. {
  42. ios_base::sync_with_stdio(false);
  43. cin.tie(0);
  44. cout.tie(0);
  45. srand(time(0));
  46.  
  47. freopen("karlsson.in", "r", stdin);
  48. freopen("karlsson.out", "w", stdout);
  49.  
  50. int x, y, z;
  51. cin >> x >> y >> z;
  52.  
  53. int mx = max(x, max(y, z));
  54.  
  55. vector<int> dp(mx + 1, 0);
  56. vector<bool> used(mx + 1, 0);
  57.  
  58. for (int i = 2; i <= mx; i++)
  59. {
  60. used.assign(mx + 1, 0);
  61.  
  62. for (int j = (i + 1) / 2; j < i; j++)
  63. {
  64. used[dp[j]] = 1;
  65. }
  66.  
  67. for (int j = 0; j <= mx; j++)
  68. {
  69. if (!used[j])
  70. {
  71. dp[i] = j;
  72. break;
  73. }
  74. }
  75. }
  76.  
  77. for (int i = (x + 1) / 2; i < x; i++)
  78. {
  79. int xx = dp[i] ^ dp[y] ^ dp[z];
  80.  
  81. if (!xx)
  82. {
  83. cout << "YES" << endl << i << " " << y << " " << z;
  84. return 0;
  85. }
  86. }
  87.  
  88. for (int i = (y + 1) / 2; i < y; i++)
  89. {
  90. int yy = dp[i] ^ dp[x] ^ dp[z];
  91.  
  92. if (!yy)
  93. {
  94. cout << "YES" << endl << x << " " << i << " " << z;
  95. return 0;
  96. }
  97. }
  98.  
  99. for (int i = (z + 1) / 2; i < z; i++)
  100. {
  101. int zz = dp[i] ^ dp[x] ^ dp[y];
  102.  
  103. if (!zz)
  104. {
  105. cout << "YES" << endl << x << " " << y << " " << i;
  106. return 0;
  107. }
  108. }
  109.  
  110. cout << "NO";
  111. return 0;
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement