Submission #1114768

# Submission time Handle Problem Language Result Execution time Memory
1114768 2024-11-19T14:50:12 Z tkwiatkowski Collecting Stamps 3 (JOI20_ho_t3) C++17
0 / 100
1 ms 336 KB
#include <iostream>

using namespace std;
int pun[200][200][2];
int powi[200];
int main()
{
    int n,l;
    cin >> n >> l;
    for (int i=0; i<n; i++){
        cin >> pun[i][i][0];
        for (int j=i; j<n; j++) pun[j][i][0]=pun[i][i][0];
        for (int j=n-i-1; j<n; j++) pun[n-1-j][i][1]=l-pun[i][i][0];
    }
    for (int i=0; i<n; i++){
        for (int j=n-1; j>i; j--) pun[i][j][0]=l-pun[j][j][0]+pun[i][i][0]*2;
        for (int 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 (int i=0; i<n; i++) cin >> powi[i];
    int wyn=0;
    for (int i=0; i<n; i++){
        for (int k=0; k<2; k++){
            int akt=0;
            for (int 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
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Incorrect 1 ms 336 KB Output isn't correct
3 Halted 0 ms 0 KB -