Submission #1114768

#TimeUsernameProblemLanguageResultExecution timeMemory
1114768tkwiatkowskiCollecting Stamps 3 (JOI20_ho_t3)C++17
0 / 100
1 ms336 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...