Submission #638905

#TimeUsernameProblemLanguageResultExecution timeMemory
638905luanaamorimFinancial Report (JOI21_financial)C++14
0 / 100
6 ms468 KiB
#include <bits/stdc++.h> #define MAX (int)(1e4 + 5) #define ll long long #define esq(x) (x<<1) #define dir(x) ((x<<1)|1) using namespace std; int n, k; ll h[MAX], tmp, resp, maior; int main() { cin >> n >> k; for (int i = 1; i <= n; i++) { cin >> h[i]; } for (int i = 1; i < (1<<n); i++) { ll maior = 0, tmp = 0; for (int j = 0; j < n; j++) { if (i&(1<<j)) { if (h[j] > maior) tmp++; maior = max(maior, h[j]); } } resp = max(resp, tmp); } cout << resp << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...