이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define sec second
#define pb push_back
#define pqueue priority_queue
#define int long long
#define pii pair<int,int>
#define supercepat ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
using namespace std;
int tc,ans=0,n,x;
int a[200005];
int b[200005];
int copa[200005];
int rec[200005];
void findlis(){
rec[1]=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=i;j++){
if(copa[j]<copa[i]) rec[i]=max(rec[i],rec[j]);
}
rec[i]++;
}
ans=max(ans,rec[n]);
}
void solve(int x,int y,int z){
for(int i=1;i<=n;i++){
copa[i]=a[i];
if(x<=i&&i<=y) copa[i]+=z;
}
findlis();
}
main(){
supercepat;
cin>>n>>x;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++){
for(int j=i;j<=n;j++){
for(int k=-x;k<=x;k++){
cout<<i<<" "<<j<<" "<<k<<endl;
solve(i,j,k);
}
}
}
cout<<ans<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
glo.cpp:33:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
33 | main(){
| ^~~~
# | 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... |