Advertisement
jbn6972

Untitled

Nov 9th, 2022
685
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.16 KB | None | 0 0
  1. // Code Written by : John Nixon
  2. // Date: 09:11:2022  Time: 20:06:24
  3. // Copyrights are applicable
  4. #include <bits/stdc++.h>
  5. using namespace std;
  6. #define int long long int
  7. #define mod 1e9 + 7
  8. #define F first
  9. #define S second
  10. #define pb push_back
  11. #define si set<int>
  12. #define vi vector<int>
  13. #define pii pair<int, int>
  14. #define vpi vector<pii>
  15. #define vpp vector<pair<int, pii>>
  16. #define mii map<int, int>
  17. #define mpi map<pii, int>
  18. #define spi set<pii>
  19. #define endl "\n"
  20. #define sz(x) ((int)x.size())
  21. #define all(p) p.begin(), p.end()
  22. #define double long double
  23. #define que_max priority_queue<int>
  24. #define que_min priority_queue<int, vi, greater<int>>
  25. #define bug(...) __f(#__VA_ARGS__, __VA_ARGS__)
  26. #define print(a)          \
  27.     for (auto x : a)      \
  28.         cout << x << " "; \
  29.     cout << endl
  30. #define print1(a)    \
  31.     for (auto x : a) \
  32.     cout << x.F << " " << x.S << endl
  33. #define print2(a, x, y)         \
  34.     for (int i = x; i < y; i++) \
  35.         cout << a[i] << " ";    \
  36.     cout << endl
  37. inline int power(int a, int b)
  38. {
  39.     int x = 1;
  40.     while (b)
  41.     {
  42.         if (b & 1)
  43.             x *= a;
  44.         a *= a;
  45.         b >>= 1;
  46.     }
  47.     return x;
  48. }
  49.  
  50. template <typename Arg1>
  51. void __f(const char *name, Arg1 &&arg1) { cout << name << " : " << arg1 << endl; }
  52. template <typename Arg1, typename... Args>
  53. void __f(const char *names, Arg1 &&arg1, Args &&...args)
  54. {
  55.     const char *comma = strchr(names + 1, ',');
  56.     cout.write(names, comma - names) << " : " << arg1 << " | ";
  57.     __f(comma + 1, args...);
  58. }
  59. const int N = 200005;
  60. void solve()
  61. {
  62.     int n;
  63.     int max = -INT_MAX;
  64.     cin>>n;
  65.     for (int i = 0; i < n; i++)
  66.     {
  67.         int x;
  68.         cin >> x;
  69.         if (x > max)
  70.         {
  71.             max = x;
  72.         }
  73.     }
  74.     cout << max << endl;
  75. }
  76. int32_t main()
  77. {
  78.     ios_base::sync_with_stdio(0);
  79.     cin.tie(0);
  80.     cout.tie(0);
  81. #ifndef ONLINE_JUDGE
  82.     freopen("input.txt", "r", stdin);
  83.     freopen("output.txt", "w", stdout);
  84. #endif
  85.     clock_t z = clock();
  86.     int t = 1;
  87.     cin >> t;
  88.     while (t--)
  89.         solve();
  90.     cerr << "Run Time : " << ((double)(clock() - z) / CLOCKS_PER_SEC);
  91.     return 0;
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement