# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
485909 | groupATSU | Studentsko (COCI14_studentsko) | C++14 | 47 ms | 412 KiB |
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 <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf=1e9;
const int maxn=100;
const ll mod=1e9+7;
void solve(){
int a,k;
cin>>a>>k;
vector <pair<int,int>> b(a);
for(int i=0;i<a;i++){
cin>>b[i].first;
b[i].second=i;
}
sort(b.begin(),b.end());
vector <int> h(a);
for(int i=0;i<a;i++){
h[b[i].second]=i/k;
}
vector <int> dp(a+5);
int ans=0;
for(int i=0;i<a;i++){
dp[i]=1;
for(int t=0;t<i;t++){
if(h[i]>=h[t]){
dp[i]=max(dp[i],dp[t]+1);
}
}
ans=max(ans,dp[i]);
}
# | 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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |