답안 #534309

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
534309 2022-03-08T04:00:16 Z Biaz Snowball (JOI21_ho_t2) C++17
0 / 100
1 ms 332 KB
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define fi first
#define se second
#define X first
#define Y second
#define ist insert
#define pii pair<int,int>
typedef long long ll;
//typedef pair<int,int> pii;
using namespace std;
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;}
const int INF=1700000000000000;//2147483647;
const int MOD=998244353;//1000000007;
const int N=200005;
struct BIT{
    int n;
    vector<int> bit;
    void init(int _n){
        n=_n;
        bit.resize(n+5,0);
    }
    void add(int i,int v){
        while (i<=n){
            bit[i]+=v;
            i+=(i&-i);
        }
    }
    int que(int i){
        int res=0;
        while (i>0){
            res+=bit[i];
            i-=(i&-i);
        }
        return res;
    }
};
int n,Q;
int a[N],w[N],res[N];
pii d[N];
int mxL,mxR;

void sol(){
    cin >>n>>Q;
    for (int i=1;i<=n;i++)
        cin >>a[i];
    a[0]=-INF;a[n+1]=INF;
    for (int i=1;i<=Q;i++)
        cin >>w[i];
    BIT tr[2];tr[0].init(n+5);tr[1].init(n+5);
    for (int i=1;i<=n+1;i++)
        d[i].fi=a[i]-a[i-1],d[i].se=i;
    sort(d+1,d+n+1,greater<pii>());
    for (int i=1;i<=n;i++)
        cout <<res[i]<<'\n';
    int cur=0;
    mxL=mxR=0;
    for (int xx=1;xx<=Q;xx++){
        cur+=w[xx];
        if (mxL<=cur&&cur<=mxR) continue;
        if (cur>0){

        }
        if (cur<0){

        }
    }
}
signed main()
{
    int _=1;
    //cin >>_;
    while (_--) sol();
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -