Advertisement
Guest User

A Innopolis

a guest
Nov 22nd, 2020
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.16 KB | None | 0 0
  1.  
  2.  //나는 가상 소녀들에게 큰 호감이 있습니다.
  3.  
  4. #include <iostream>
  5. #include <cmath>
  6. #include <algorithm>
  7. #include <stdio.h>
  8. #include <cstring>
  9. #include <string>
  10. #include <cstdlib>
  11. #include <vector>
  12. #include <bitset>
  13. #include <map>
  14. #include <chrono>
  15. #include <functional>
  16. #include <unordered_set>
  17. #include <unordered_map>
  18. #include <numeric>
  19. #include <queue>
  20. #include <ctime>
  21. #include <stack>
  22. #include <set>
  23. #include <list>
  24. #include <deque>
  25. #include <iomanip>
  26. #include <sstream>
  27. #include <fstream>
  28. #include <stdarg.h>
  29. #include <utility>
  30.  
  31. using namespace std;
  32.  
  33. #define pb push_back
  34. #define mp make_pair
  35. #define ll long long
  36. #define ull unisgned long long
  37. #define ld long double
  38. #define all(a) a.begin(), a.end()
  39. #define SORT(a) sort(all(a))
  40. #define pii pair<int, int>
  41. #define tii triple<int, int, int>
  42. #define e 1e-7
  43. #define PI acos(-1)
  44. #define sz(a) (int)(a.size())
  45. #define inf 1e17
  46. #define vi vector<int>
  47. #define F first
  48. #define S second
  49. #define rng(x) for(int _ = 0; _ < (x); _++)
  50. #define rngi(i, x) for(int i = 0; i < (x); i++)
  51. #define rngsi(s, i, x) for(int i = (s); i <(x); i++)
  52. #define int long long
  53. #define problem "a"
  54.  
  55. template<typename A, typename B, typename C>
  56. struct triple {
  57.     A X;
  58.     B Y;
  59.     C Z;
  60.     triple(A a = 0, B b = 0, C c = 0) :X(a), Y(b), Z(c) {}
  61. };
  62. template<typename A, typename B, typename C>
  63. triple<A, B, C> make_triple(A a = 0, B b = 0, C c = 0) {
  64.     return triple<A, B, C>(a, b, c);
  65. }
  66. template<typename A, typename B, typename C>
  67. bool operator<(const triple<A, B, C>& a, const triple<A, B, C>& b) {
  68.     if (a.X != b.X)
  69.         return a.X < b.X;
  70.     if (a.Y != b.Y)
  71.         return a.Y < b.Y;
  72.     return a.Z < b.Z;
  73. }
  74. template<typename T, typename SS>
  75. ostream& operator<<(ostream& ofs, const pair<T, SS>& p) {
  76.     ofs << "( " << p.F << " , " << p.S << " )";
  77.     return ofs;
  78. }
  79. template<typename T>
  80. void print(T a) {
  81.     for (auto i : a)
  82.         cout << i << ' ';
  83.     cout << '\n';
  84. }
  85. template<typename T>
  86. T max(T a, T b, T c) {
  87.     return max(a, max(b, c));
  88. }
  89. template<typename T>
  90. T min(T a, T b, T c) {
  91.     return min(a, min(b, c));
  92. }
  93. template<typename T, typename D>
  94. D min(T a) {
  95.     return *min_element(all(a));
  96. }
  97. template<typename T, typename D>
  98. D max(T a) {
  99.     return *max_element(all(a));
  100. }
  101. struct custom_hash {
  102.     static uint64_t splitmix64(uint64_t x) {
  103.         x += 0x9e3779b97f4a7c15;
  104.         x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
  105.         x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
  106.         return x ^ (x >> 31);
  107.     }
  108.  
  109.     size_t operator()(uint64_t x) const {
  110.         static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
  111.         return splitmix64(x + FIXED_RANDOM);
  112.     }
  113. };
  114. void solve() {
  115.     int a, b; cin >> a >> b;
  116.     if (a % 3 != b % 3)return void(cout << "-1\n");
  117.     cout << a / 3 << ' ' << a % 3 << ' ' << b / 3 << '\n';
  118. };
  119. signed main()
  120. {
  121.     if (0) {
  122.         freopen(problem".in", "r", stdin);
  123.         freopen(problem".out", "w", stdout);
  124.     }
  125.     srand(time(NULL));
  126.     cin.tie(0);
  127.     cout.tie(0);
  128.     ios_base::sync_with_stdio(false);
  129.     int t = 1;// cin >> t;
  130.     rng(t) solve();
  131. }
  132.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement