Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.93 KB | None | 0 0
  1. /*#pragma GCC optimize("Ofast,no-stack-protector")
  2. #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
  3. #pragma GCC optimize("unroll-loops")
  4. #pragma GCC optimize("fast-math")
  5. #pragma GCC optimize("section-anchors")
  6. #pragma GCC optimize("profile-values,profile-reorder-functions,tracer")
  7. #pragma GCC optimize("vpt")
  8. #pragma GCC optimize("rename-registers")
  9. #pragma GCC optimize("move-loop-invariants")
  10. #pragma GCC optimize("unswitch-loops")
  11. #pragma GCC optimize("function-sections")
  12. #pragma GCC optimize("data-sections")
  13. #pragma GCC optimize("branch-target-load-optimize")
  14. #pragma GCC optimize("branch-target-load-optimize2")
  15. #pragma GCC optimize("btr-bb-exclusive")*/
  16. #define _CRT_SECURE_NO_WARNINGS
  17. #include <chrono>
  18. #include <set>
  19. #include <map>
  20. #include <deque>
  21. #include <cmath>
  22. #include <queue>
  23. #include <cassert>
  24. #include <random>
  25. #include <bitset>
  26. #include <iomanip>
  27. #include <numeric>
  28. #include <time.h>//////////////
  29. #include <ctime>
  30. #include <string>
  31. #include <cstdio>
  32. #include <vector>
  33. #include <cstdlib>
  34. #include <iostream>
  35. #include <algorithm>
  36. #include <unordered_map>
  37. #include <unordered_set>
  38. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  39. //#define endl '\n'
  40. #define mp make_pair
  41. #define pbc push_back
  42. #define pob pop_back()
  43. #define empb emplace_back
  44. #define queuel queue<long long>
  45. #define sqr(a) ((a) * (a))
  46. #define all(x) (x).begin(), (x).end()
  47. #define rall(x) (x).rbegin(), (x).rend()
  48. #define pin(p) cin >> p.first >> p.second;
  49. #define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
  50. #define rev(v) reverse(v.begin(), v.end());
  51. #define sout(s, c) for (auto i : s) cout << i << c;
  52. #define pout(p) cout << p.first << " " << p.second;
  53. #define er(v, l, r) erase(v.begin() + l, v.begin() + r);
  54. #define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
  55. #define vout(v, c) for (int i = 0; i < v.size(); ++i) cout << v[i] << c;
  56. #define pushi(v, a) for (int i = 0; i < a.size(); ++i) v.push_back(a[i]);
  57. #define fastio() ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); srand(time(NULL))
  58. #define sp system("pause")
  59. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  60. using namespace std;
  61. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  62. typedef long long ll;
  63. typedef long double ld;
  64. typedef unsigned long long ull;
  65. //++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
  66. const ld EPS = 1e-9;
  67. const int inf = 1e9;
  68. const ld PI = acos(-1);
  69. int mod = (int)998244353;
  70. const int MOD7 = 1000000007;
  71. const int MOD9 = 1000000009;
  72. const int a228 = 18;
  73. const ll kekmod = 1791791791;
  74. const ll bestmod = 1148822869;
  75. const ll secmod = (int) 1e9 + 113;
  76. vector<ll> mods = { kekmod,bestmod,mod,MOD9,1000000007 };
  77. vector<ll> hashpows = { 29,31,37,43,47,53,179,229 };
  78. //mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count() + 228 + 'i' + 'q' + 1337 + 1488);
  79. //ll MOD = mods[rnd() % mods.size()];
  80. //ll hashpow = hashpows[rand() % hashpows.size()];
  81. bool leap(ull y)
  82. {
  83. return (y % 400 == 0) || (y % 4 == 0 && y % 100);
  84. }
  85. signed main()
  86. {
  87. fastio();
  88. vector<int> ds{0, 31,28,31,30,31,30,31,31,30,31,30,31 };
  89. int a, b;
  90. ull x;
  91. char c;
  92. cin >> b >>c>> a >>c>> x;
  93. if (leap(x)) ds[2]++;
  94. if (a <= 0 || b <= 0 || a > 12 || b > ds[a])
  95. {
  96. cout << "WRONG DATE";
  97. return 0;
  98. }
  99. ++b;
  100. if (b > ds[a])
  101. {
  102. a++;
  103. b = 1;
  104. }
  105. if (a == 13)
  106. {
  107. a = 1;
  108. x++;
  109. }
  110. printf("%02d.%02d.%02llu", b,a, x);
  111. // sp;
  112. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement