fork download
  1. /*
  2. " وَكَانَ فَضْلُ اللَّهِ عَلَيْكَ عَظِيمًا "
  3.  
  4. ╔░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╗
  5. ║ ║
  6. ║ ███╗ ███╗ ██████╗ ██╗ ██╗ █████╗ ███╗ ███╗ ███████╗ ██████╗ ║
  7. ║ ████╗ ████║██╔═══██╗██║ ██║ ██╔══██╗ ████╗ ████║ ██╔════╝ ██╔══██╗ ║
  8. ║ ██╔████╔██║██║ ██║███████║ ███████║ ██╔████╔██║ █████╗ ██║ ██║ ║
  9. ║ ██║╚██╔╝██║██║ ██║██╔══██║ ██╔══██║ ██║╚██╔╝██║ ██╔══╝ ██║ ██║ ║
  10. ║ ██║ ╚═╝ ██║╚██████╔╝██║ ██║ ██║ ██║ ██║ ╚═╝ ██║ ███████╗ ██████╔╝ ║
  11. ║ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═════╝ ║
  12. ║ ║
  13. ║ ██╗ ██╗ ██████╗ ███████╗ ███████╗ █████╗ ███╗ ███╗ ║
  14. ║ ██║ ██║ ██╔═══██╗ ██╔════╝ ██╔════╝ ██╔══██╗ ████╗ ████║ ║
  15. ║ ███████║ ██║ ██║ ███████╗ ███████╗ ███████║ ██╔████╔██║ ║
  16. ║ ██╔══██║ ██║ ██║ ╚════██║ ╚════██║ ██╔══██║ ██║╚██╔╝██║ ║
  17. ║ ██║ ██║ ╚██████╔╝ ███████║ ███████║ ██║ ██║ ██║ ╚═╝ ██║ ║
  18. ║ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ║
  19. ║ ║
  20. ╚░░░░░░░░░░░░░░░░░░░░░░░ MOHAMED HOSSAM | SOFTWARE ENGINEER ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╝
  21. */
  22.  
  23. #include"bits/stdc++.h"
  24. using namespace std;
  25. #define el '\n'
  26. #define ll long long
  27. #define int ll
  28. #define yes cout << "YES\n"
  29. #define no cout << "NO\n"
  30. #define all(x) (x).begin(), (x).end()
  31. #define rall(x) x.rbegin(), x.rend()
  32. #define sz(x) ((int)(x).size())
  33.  
  34. template<class T, class U>
  35. T GCD(T a, U b) { return (!b ? a : GCD(b, a % b)); }
  36.  
  37. template<class T, class U>
  38. T LCM(T a, U b) { return ((a / GCD(a, b)) * b); }
  39.  
  40. constexpr ll MAX = 300000, MOD = 998244353, MAXN = 2e5 + 10, inf = 1e18;
  41. using vi = vector<int>;
  42.  
  43. inline void free_palestine() {
  44. ios_base::sync_with_stdio(false);
  45. cin.tie(NULL);
  46. cout.tie(NULL);
  47.  
  48. #ifndef ONLINE_JUDGE
  49. freopen("inputs.txt", "r", stdin);
  50. freopen("output.txt", "w", stdout);
  51. #endif
  52. }
  53.  
  54. template<typename T>
  55. istream &operator>>(istream &in, vector<T> &v) {
  56. for (auto &x: v) in >> x;
  57. return in;
  58. }
  59.  
  60. template<typename T>
  61. ostream &operator<<(ostream &out, const vector<T> &v) {
  62. for (const auto &x: v) out << x << ' ';
  63. return out;
  64. }
  65.  
  66. void solve(int tc) {
  67. int n;cin>>n;
  68.  
  69. vi x(n), y(n);cin>>x>>y;
  70.  
  71. int dp = 0;
  72. for (int i =n-1;i>=0;i--) {
  73. dp = max( x[i] - y[i] + dp, -dp);
  74. }
  75. string ans;
  76. if (dp > 0) {
  77. ans="Sunny";
  78. } else if (dp < 0) {
  79. ans="Aubrey";
  80. } else {
  81. ans="Draw";
  82. }
  83. cout<<ans<<el;
  84. }
  85.  
  86. int32_t main() {
  87. free_palestine();
  88. // freopen("collectingofficer.in", "r", stdin);// freopen("palindrome.out", "w", stdout);
  89. int tc = 1;
  90.  
  91. cin >> tc;
  92. for (int i = 1; i <= tc; ++i) {
  93. solve(i);
  94. }
  95. }
  96.  
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
Draw