This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef tuple<int,int,int> trio;
const int MAXN = 5e4+10;
#define pb push_back
#define f first
#define s second
int n, h[55], w[55], resp;
int main() {
cin >> n;
for(int i = 1; i <= n; i++)
cin >> h[i];
for(int i = 1; i <= n; i++)
cin >> w[i];
for(int i = 1; i <= n; i++) {
for(int j = i, l = 100; j <= n; j++) {
l = min(h[i], l);
resp += l*(l+1)/2;
resp %= (int)(1e9+7);
}
}
cout << resp << "\n";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |