#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
504 KB |
Output is correct |
2 |
Incorrect |
1 ms |
336 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |