fork download
  1. #include <bits/stdc++.h>
  2. #define ll long long
  3. #define int long long
  4. #define double long double
  5. #define endl "\n"
  6. #define fi first
  7. #define se second
  8. #define MASK(i) (1LL << (i))
  9. #define BIT(x, i) (((x) >> (i)) & 1)
  10. #define creby_ThienNhan return 0;
  11. #define qnorz ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  12. using namespace std;
  13. const int LimN=1e6+5;
  14. const int N=1e5+5;
  15. const int M=1e3+5;
  16. const int BASE=256;
  17. const int mod=1e9+7;
  18. char d4c[4]={'R','D','L','U'};
  19. ll d4x[4]={0,1,0,-1};
  20. ll d4y[4]={1,0,-1,0};
  21. ll d4x_tuong[4]={-2,-2,2,2};
  22. ll d4y_tuong[4]={-2,2,-2,2};
  23. ll d8x[8]={0,1,-1,0,-1,1,1,-1};
  24. ll d8y[8]={1,0,0,-1,-1,1,-1,1};
  25. ll d8x_ma[8]={-1,-1,+1,+1,-2,-2,+2,+2};
  26. ll d8y_ma[8]={-2,+2,-2,+2,-1,+1,-1,+1};
  27. template<class X, class Y>
  28. bool maximize(X& x, const Y y) {
  29. if (y > x) {x = y; return true;}
  30. return false;
  31. }
  32. template<class X, class Y>
  33. bool minimize(X& x, const Y y) {
  34. if (y < x) {x = y; return true;}
  35. return false;
  36. }
  37. ll pow1(ll a, ll b, ll c){
  38. ll tich = 1;
  39. a = a % c;
  40. for (; b > 0; b >>= 1 , a = a * a % c){
  41. if (b & 1) tich = tich * a % c;
  42. }
  43. return tich;
  44. }
  45. ll pow2(ll a, ll b, ll mod) {
  46. ll res = 1;
  47. a %= mod;
  48. while(b > 0) {
  49. if(b & 1) res = (res * a) % mod;
  50. a = (a * a) % mod;
  51. b >>= 1;
  52. }
  53. return res;
  54. }
  55. namespace SUB1{
  56.  
  57. }
  58. namespace SUB2{
  59.  
  60. }
  61. namespace SUB3{
  62.  
  63. }
  64. int n;
  65. int a[LimN];
  66. void solve() {
  67. //Bước 1:
  68. cin >> n;
  69. for (int i=1; i<=n; i++) cin >> a[i];
  70. //Bước 2:
  71. int max1=0;
  72. for (int i=1; i<=n; i++) {
  73. if (max1 < a[i]) max1=a[i];
  74. }
  75. // Bước 3:
  76. cout << max1 << endl;
  77. }
  78. signed main() {
  79. qnorz
  80. ll t=1;
  81. while (t--) {
  82. solve();
  83. }
  84. creby_ThienNhan
  85. }
  86.  
  87.  
Success #stdin #stdout 0s 5328KB
stdin
5
1 5 2 10 8
stdout
10