Advertisement
Guest User

A Innopolis

a guest
Nov 22nd, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.30 KB | None | 0 0
  1. //나는 가상 소녀들에게 큰 호감이 있습니다.
  2.  
  3. #include <iostream>
  4. #include <cmath>
  5. #include <algorithm>
  6. #include <stdio.h>
  7. #include <cstring>
  8. #include <string>
  9. #include <cstdlib>
  10. #include <vector>
  11. #include <bitset>
  12. #include <map>
  13. #include <chrono>
  14. #include <functional>
  15. #include <unordered_set>
  16. #include <unordered_map>
  17. #include <numeric>
  18. #include <queue>
  19. #include <ctime>
  20. #include <stack>
  21. #include <set>
  22. #include <list>
  23. #include <deque>
  24. #include <iomanip>
  25. #include <sstream>
  26. #include <fstream>
  27. #include <stdarg.h>
  28. #include <utility>
  29.  
  30. using namespace std;
  31.  
  32. #define pb push_back
  33. #define mp make_pair
  34. #define ll long long
  35. #define ull unisgned long long
  36. #define ld long double
  37. #define all(a) a.begin(), a.end()
  38. #define SORT(a) sort(all(a))
  39. #define pii pair<int, int>
  40. #define tii triple<int, int, int>
  41. #define e 1e-7
  42. #define PI acos(-1)
  43. #define sz(a) (int)(a.size())
  44. #define inf 1e17
  45. #define vi vector<int>
  46. #define F first
  47. #define S second
  48. #define rng(x) for(int _ = 0; _ < (x); _++)
  49. #define rngi(i, x) for(int i = 0; i < (x); i++)
  50. #define rngsi(s, i, x) for(int i = (s); i <(x); i++)
  51. #define int long long
  52. #define problem "a"
  53.  
  54. template<typename A, typename B, typename C>
  55. struct triple {
  56.     A X;
  57.     B Y;
  58.     C Z;
  59.     triple(A a = 0, B b = 0, C c = 0) :X(a), Y(b), Z(c) {}
  60. };
  61. template<typename A, typename B, typename C>
  62. triple<A, B, C> make_triple(A a = 0, B b = 0, C c = 0) {
  63.     return triple<A, B, C>(a, b, c);
  64. }
  65. template<typename A, typename B, typename C>
  66. bool operator<(const triple<A, B, C>& a, const triple<A, B, C>& b) {
  67.     if (a.X != b.X)
  68.         return a.X < b.X;
  69.     if (a.Y != b.Y)
  70.         return a.Y < b.Y;
  71.     return a.Z < b.Z;
  72. }
  73. template<typename T, typename SS>
  74. ostream& operator<<(ostream& ofs, const pair<T, SS>& p) {
  75.     ofs << "( " << p.F << " , " << p.S << " )";
  76.     return ofs;
  77. }
  78. template<typename T>
  79. void print(T a) {
  80.     for (auto i : a)
  81.         cout << i << ' ';
  82.     cout << '\n';
  83. }
  84. template<typename T>
  85. T max(T a, T b, T c) {
  86.     return max(a, max(b, c));
  87. }
  88. template<typename T>
  89. T min(T a, T b, T c) {
  90.     return min(a, min(b, c));
  91. }
  92. template<typename T, typename D>
  93. D min(T a) {
  94.     return *min_element(all(a));
  95. }
  96. template<typename T, typename D>
  97. D max(T a) {
  98.     return *max_element(all(a));
  99. }
  100. struct custom_hash {
  101.     static uint64_t splitmix64(uint64_t x) {
  102.         x += 0x9e3779b97f4a7c15;
  103.         x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
  104.         x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
  105.         return x ^ (x >> 31);
  106.     }
  107.  
  108.     size_t operator()(uint64_t x) const {
  109.         static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
  110.         return splitmix64(x + FIXED_RANDOM);
  111.     }
  112. };
  113. void solve() {
  114.     int a, b; cin >> a >> b;
  115.     if (a % 3 != b % 3)return void(cout << "-1\n");
  116.     cout << a / 3 << ' ' << a % 3 << ' ' << b / 3 << '\n';
  117. };
  118. signed main()
  119. {
  120.     if (0) {
  121.         freopen(problem".in", "r", stdin);
  122.         freopen(problem".out", "w", stdout);
  123.     }
  124.     srand(time(NULL));
  125.     cin.tie(0);
  126.     cout.tie(0);
  127.     ios_base::sync_with_stdio(false);
  128.     int t = 1;// cin >> t;
  129.     rng(t) solve();
  130. }
  131. //나는 가상 소녀들에게 큰 호감이 있습니다.
  132.  
  133. #include <iostream>
  134. #include <cmath>
  135. #include <algorithm>
  136. #include <stdio.h>
  137. #include <cstring>
  138. #include <string>
  139. #include <cstdlib>
  140. #include <vector>
  141. #include <bitset>
  142. #include <map>
  143. #include <chrono>
  144. #include <functional>
  145. #include <unordered_set>
  146. #include <unordered_map>
  147. #include <numeric>
  148. #include <queue>
  149. #include <ctime>
  150. #include <stack>
  151. #include <set>
  152. #include <list>
  153. #include <deque>
  154. #include <iomanip>
  155. #include <sstream>
  156. #include <fstream>
  157. #include <stdarg.h>
  158. #include <utility>
  159.  
  160. using namespace std;
  161.  
  162. #define pb push_back
  163. #define mp make_pair
  164. #define ll long long
  165. #define ull unisgned long long
  166. #define ld long double
  167. #define all(a) a.begin(), a.end()
  168. #define SORT(a) sort(all(a))
  169. #define pii pair<int, int>
  170. #define tii triple<int, int, int>
  171. #define e 1e-7
  172. #define PI acos(-1)
  173. #define sz(a) (int)(a.size())
  174. #define inf 1e17
  175. #define vi vector<int>
  176. #define F first
  177. #define S second
  178. #define rng(x) for(int _ = 0; _ < (x); _++)
  179. #define rngi(i, x) for(int i = 0; i < (x); i++)
  180. #define rngsi(s, i, x) for(int i = (s); i <(x); i++)
  181. #define int long long
  182. #define problem "a"
  183.  
  184. template<typename A, typename B, typename C>
  185. struct triple {
  186.     A X;
  187.     B Y;
  188.     C Z;
  189.     triple(A a = 0, B b = 0, C c = 0) :X(a), Y(b), Z(c) {}
  190. };
  191. template<typename A, typename B, typename C>
  192. triple<A, B, C> make_triple(A a = 0, B b = 0, C c = 0) {
  193.     return triple<A, B, C>(a, b, c);
  194. }
  195. template<typename A, typename B, typename C>
  196. bool operator<(const triple<A, B, C>& a, const triple<A, B, C>& b) {
  197.     if (a.X != b.X)
  198.         return a.X < b.X;
  199.     if (a.Y != b.Y)
  200.         return a.Y < b.Y;
  201.     return a.Z < b.Z;
  202. }
  203. template<typename T, typename SS>
  204. ostream& operator<<(ostream& ofs, const pair<T, SS>& p) {
  205.     ofs << "( " << p.F << " , " << p.S << " )";
  206.     return ofs;
  207. }
  208. template<typename T>
  209. void print(T a) {
  210.     for (auto i : a)
  211.         cout << i << ' ';
  212.     cout << '\n';
  213. }
  214. template<typename T>
  215. T max(T a, T b, T c) {
  216.     return max(a, max(b, c));
  217. }
  218. template<typename T>
  219. T min(T a, T b, T c) {
  220.     return min(a, min(b, c));
  221. }
  222. template<typename T, typename D>
  223. D min(T a) {
  224.     return *min_element(all(a));
  225. }
  226. template<typename T, typename D>
  227. D max(T a) {
  228.     return *max_element(all(a));
  229. }
  230. struct custom_hash {
  231.     static uint64_t splitmix64(uint64_t x) {
  232.         x += 0x9e3779b97f4a7c15;
  233.         x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
  234.         x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
  235.         return x ^ (x >> 31);
  236.     }
  237.  
  238.     size_t operator()(uint64_t x) const {
  239.         static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
  240.         return splitmix64(x + FIXED_RANDOM);
  241.     }
  242. };
  243. void solve() {
  244.     int a, b; cin >> a >> b;
  245.     if (a % 3 != b % 3)return void(cout << "-1\n");
  246.     cout << a / 3 << ' ' << a % 3 << ' ' << b / 3 << '\n';
  247. };
  248. signed main()
  249. {
  250.     if (0) {
  251.         freopen(problem".in", "r", stdin);
  252.         freopen(problem".out", "w", stdout);
  253.     }
  254.     srand(time(NULL));
  255.     cin.tie(0);
  256.     cout.tie(0);
  257.     ios_base::sync_with_stdio(false);
  258.     int t = 1;// cin >> t;
  259.     rng(t) solve();
  260. }
  261.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement