Submission #19598815


Source Code Expand

#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define fst first
#define snd second
#define pb push_back
#define ALL(x) x.begin(),x.end()
#define EPS (1e-9)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

bool LT(double a,double b) { return !equals(a,b) && a < b; }
bool LTE(double a,double b) { return equals(a,b) || a < b; }

const string YES = "";
const string NO  = "";

typedef long long ll;
typedef pair<int,int> ii;

void solve() {

}

int main() {
  int n;
  cin >> n;
  vector<ll> vec(n);
  rep(i,n) cin >> vec[i];
  ll maxi = 0;
  rep(L,n) {
    ll mini = vec[L];
    REP(R,L,n) {
      mini = min(mini,vec[R]);
      maxi = max(maxi,(R-L+1LL)*mini);
    }
  }
  cout << maxi << endl;
  return 0;
}

Submission Info

Submission Time
Task C - Mandarin Orange
User Eldora
Language C++ (GCC 9.2.1)
Score 300
Code Size 812 Byte
Status AC
Exec Time 56 ms
Memory 3692 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 2
AC × 33
Set Name Test Cases
Sample sample_01.txt, sample_02.txt
All min_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt, random_30.txt, sample_01.txt, sample_02.txt
Case Name Status Exec Time Memory
min_01.txt AC 6 ms 3576 KiB
random_01.txt AC 41 ms 3660 KiB
random_02.txt AC 39 ms 3500 KiB
random_03.txt AC 54 ms 3560 KiB
random_04.txt AC 41 ms 3504 KiB
random_05.txt AC 41 ms 3612 KiB
random_06.txt AC 56 ms 3564 KiB
random_07.txt AC 39 ms 3608 KiB
random_08.txt AC 42 ms 3636 KiB
random_09.txt AC 55 ms 3628 KiB
random_10.txt AC 39 ms 3692 KiB
random_11.txt AC 41 ms 3556 KiB
random_12.txt AC 56 ms 3616 KiB
random_13.txt AC 38 ms 3600 KiB
random_14.txt AC 40 ms 3544 KiB
random_15.txt AC 53 ms 3672 KiB
random_16.txt AC 40 ms 3632 KiB
random_17.txt AC 40 ms 3608 KiB
random_18.txt AC 55 ms 3568 KiB
random_19.txt AC 38 ms 3648 KiB
random_20.txt AC 41 ms 3500 KiB
random_21.txt AC 55 ms 3672 KiB
random_22.txt AC 39 ms 3684 KiB
random_23.txt AC 40 ms 3656 KiB
random_24.txt AC 54 ms 3580 KiB
random_25.txt AC 38 ms 3540 KiB
random_26.txt AC 41 ms 3612 KiB
random_27.txt AC 54 ms 3676 KiB
random_28.txt AC 41 ms 3620 KiB
random_29.txt AC 41 ms 3644 KiB
random_30.txt AC 55 ms 3648 KiB
sample_01.txt AC 2 ms 3548 KiB
sample_02.txt AC 2 ms 3496 KiB