Submission #405630

# Submission time Handle Problem Language Result Execution time Memory
405630 2021-05-16T15:36:47 Z Fidisk Arcade (NOI20_arcade) C++14
0 / 100
1 ms 464 KB
#include <bits/stdc++.h>
using namespace std;

#define oo 1e15
#define fi first
#define se second
#define sp(iiii) setprecision(iiii)
#define IO ios_base::sync_with_stdio(false); cin.tie(0)
#define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa))
#define cntbit(xxxx) __builtin_popcount(xxxx)
#define getbit(xxxx,aaaa) ((xxxx>>(aaaa-1))&1)

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pair<int,int>,int> piii;
typedef pair<long long,long long> pll;
typedef pair<pair<long long,long long>,long long> plll;
typedef pair<pair<long long,long long>,pair<long long,long long>> pllll;
typedef pair<pair<long long,long long>,bool> pllb;

const ll base=361;
const ll mod=998244353;
const ld eps=1e-5;
const ll maxn=1e9+9;

ll m,n,i,c[1000009],res,f[1000009],j,ans;
pll a[1000009],b[1000009];

int main(){
    IO;
    cin>>m>>n;
    for (i=1;i<=n;i++) {
        cin>>a[i].fi;
    }
    for (i=1;i<=n;i++) {
        cin>>a[i].se;
    }
    for (i=1;i<=n;i++) {
        b[i]={a[i].fi-a[i].se,a[i].fi+a[i].se};
    }
    sort(b+1,b+n+1);
    for (i=1;i<=n;i++) {
        c[i]=b[i].se;
        f[i]=oo;
    }
    for (i=1;i<=n;i++) {
        ans=0;
        for (j=n;j>0;j/=2) {
            while (ans+j<=n&&c[i]>f[ans+j]) {
                ans+=j;
            }
        }
        f[ans+1]=c[i];
        res=max(res,ans+1);
    }
    cout<<res<<'\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 464 KB Output isn't correct
2 Halted 0 ms 0 KB -