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 <iostream>
using namespace std;
int64_t pun[200][200][2];
int64_t powi[200];
int main()
{
int n,l;
cin >> n >> l;
for (int64_t i=0; i<n; i++){
cin >> pun[i][i][0];
for (int64_t j=i; j<n; j++) pun[j][i][0]=pun[i][i][0];
for (int64_t j=n-i-1; j<n; j++) pun[n-1-j][i][1]=l-pun[i][i][0];
}
for (int64_t i=0; i<n; i++){
for (int64_t j=n-1; j>i; j--) pun[i][j][0]=l-pun[j][j][0]+pun[i][i][0]*2;
for (int64_t j=0; j<i; j++) pun[i][j][1]=pun[i][i][1]*2+pun[j][j][0];
}
/*for (int i=0; i<n; i++){
for (int j=0; j<2; j++){
for (int k=0; k<n; k++) cout << pun[i][k][j] << ' ';
cout << '\n';
}
}*/
for (int64_t i=0; i<n; i++) cin >> powi[i];
int64_t wyn=0;
for (int64_t i=0; i<n; i++){
for (int64_t k=0; k<2; k++){
int64_t akt=0;
for (int64_t j=0; j<n; j++){
if (pun[i][j][k]<=powi[j]) akt++;
//cout << pun[i][j][k] << ' ' << powi[j] << '\n';
}
//cout << '\n';
wyn=max(wyn,akt);
}
}
cout << wyn;
}
# | 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... |