QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#344448#4897. 音符大师ANIG15 207ms155668kbC++148.3kb2024-03-04 16:19:482024-03-04 16:19:48

Judging History

你现在查看的是最新测评结果

  • [2024-03-04 16:19:48]
  • 评测
  • 测评结果:15
  • 用时:207ms
  • 内存:155668kb
  • [2024-03-04 16:19:48]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5,inf=1e15;
namespace sgt{
    struct node{
        int l,r,sm;
    }p[N<<2];
    void upset(int x){
        p[x].sm=min(p[x<<1].sm,p[x<<1|1].sm);
    }
    void reset(int x,int l,int r){
        p[x].l=l,p[x].r=r;
        p[x].sm=inf;
        if(l==r)return;
        int mid=l+r>>1;
        reset(x<<1,l,mid);
        reset(x<<1|1,mid+1,r);
    }
    void sets(int x,int d,int sm){
        if(p[x].l==p[x].r){
            p[x].sm=sm;
            return;
        }
        int mid=p[x].l+p[x].r>>1;
        if(d<=mid)sets(x<<1,d,sm);
        else sets(x<<1|1,d,sm);
        upset(x);
    }
    int gets(int x,int l,int r){
        if(l>r)return inf;
        if(l<=p[x].l&&r>=p[x].r)return p[x].sm;
        int mid=p[x].l+p[x].r>>1;
        if(r<=mid)return gets(x<<1,l,r);
        if(l>mid)return gets(x<<1|1,l,r);
        return min(gets(x<<1,l,r),gets(x<<1|1,l,r));
    }
}
namespace tr{
    struct node{
        int sm1,sm2,laz;
        signed lson,rson;
    }p[N*100];
    int idx,w[N];
    int nw(){
        idx++;
        p[idx].sm1=p[idx].sm2=inf;
        return idx;
    }
    void init(int x){
        if(!p[x].lson)p[x].lson=nw();
        if(!p[x].rson)p[x].rson=nw();
    }
    void add(int x,int sm){
        p[x].sm1+=sm;
        p[x].sm2+=sm;
        p[x].laz+=sm;
    }
    void dnset(int x){
        if(p[x].laz){
            add(p[x].lson,p[x].laz);
            add(p[x].rson,p[x].laz);
            p[x].laz=0;
        }
    }
    void upset(int x){
        p[x].sm1=min(p[p[x].lson].sm1,p[p[x].rson].sm1);
        p[x].sm2=min(p[p[x].lson].sm2,p[p[x].rson].sm2);
    }
    void sets(int x,int d,int sm,int nl,int nr){
        if(nl==nr){
            p[x].sm1=min(p[x].sm1,sm-w[d]);
            p[x].sm2=min(p[x].sm2,sm+w[d]);
            return;
        }
        int mid=nl+nr>>1;
        init(x);
        dnset(x);
        if(d<=mid)sets(p[x].lson,d,sm,nl,mid);
        else sets(p[x].rson,d,sm,mid+1,nr);
        upset(x);
    }
    int gets1(int x,int l,int r,int nl,int nr){
        if(!x)return inf;
        if(l<=nl&&r>=nr)return p[x].sm1;
        int mid=nl+nr>>1;
        dnset(x);
        if(r<=mid)return gets1(p[x].lson,l,r,nl,mid);
        if(l>mid)return gets1(p[x].rson,l,r,mid+1,nr);
        return min(gets1(p[x].lson,l,r,nl,mid),gets1(p[x].rson,l,r,mid+1,nr));
    }
    int gets2(int x,int l,int r,int nl,int nr){
        if(!x)return inf;
        if(l<=nl&&r>=nr)return p[x].sm2;
        int mid=nl+nr>>1;
        dnset(x);
        if(r<=mid)return gets2(p[x].lson,l,r,nl,mid);
        if(l>mid)return gets2(p[x].rson,l,r,mid+1,nr);
        return min(gets2(p[x].lson,l,r,nl,mid),gets2(p[x].rson,l,r,mid+1,nr));
    }
    int gets(int x,int d,int nl,int nr){
        if(!x)return inf;
        if(nl==nr)return p[x].sm1+w[nl];
        int mid=nl+nr>>1;
        dnset(x);
        if(d<=mid)return gets(p[x].lson,d,nl,mid);
        else return gets(p[x].rson,d,mid+1,nr);
    }
    void hb(int a,int b,int nl,int nr){
        if(nl==nr){
            p[a].sm1=min(p[a].sm1,p[b].sm1);
            p[a].sm2=min(p[a].sm2,p[b].sm2);
            return;
        }
        int mid=nl+nr>>1;
        dnset(a);dnset(b);
        if(p[a].lson){
            if(p[b].lson)hb(p[a].lson,p[b].lson,nl,mid);
        }else if(p[b].lson)p[a].lson=p[b].lson;
        if(p[a].rson){
            if(p[b].rson)hb(p[a].rson,p[b].rson,mid+1,nr);
        }else if(p[b].rson)p[a].rson=p[b].rson;
        upset(a);
    }
}
int n,k,p[N],nxt1[N],nxt2[N],al,res=inf,rt[N];
vector<int>ls;
int gets(int x){
    return upper_bound(ls.begin(),ls.end(),x)-ls.begin();
}
void chk(int&a,int b){
    a=min(a,b);
}
struct node{
    int l1,r1,l2,r2;
    friend bool operator<(node a,node b){
        if(a.l1!=b.l1)return a.l1<b.l1;
        if(a.r1!=b.r1)return a.r1<b.r1;
        if(a.l2!=b.l2)return a.l2<b.l2;
        return a.r2<b.r2;
    }
};
map<node,int>mp[N];
int gets(int nw,int l1,int r1,int l2,int r2){
    return mp[nw][{l1,r1,l2,r2}];
}
vector<node>q[N];
signed main(){
   // freopen("ex_game3.in","r",stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n>>k;
    for(int i=1;i<=n;i++){
        cin>>p[i];
        ls.push_back(p[i]);
        if(p[i]-k>=0)ls.push_back(p[i]-k);
    }
    ls.push_back(0);
    sort(ls.begin(),ls.end());
    ls.resize(unique(ls.begin(),ls.end())-ls.begin());
    al=ls.size();
    for(int i=1;i<=al;i++)tr::w[i]=ls[i-1];
    tr::p[0].sm1=tr::p[0].sm2=inf;
    sgt::reset(1,1,al);
    for(int i=n;i>=0;i--){
        int a=gets(p[i]-k),b=gets(p[i]),c=gets(p[i]+k);
        nxt1[i]=min(sgt::gets(1,1,a-1),sgt::gets(1,b+1,al));
        nxt2[i]=min(sgt::gets(1,1,b-1),sgt::gets(1,c+1,al));
        sgt::sets(1,b,i);
    }
    for(int i=0;i<=n;i++){
        int a,b,c,d;
        if(nxt1[i]<=n){
            a=gets(p[nxt1[i]]-k),b=gets(p[nxt1[i]]);
            for(int j=b;j>=a;j--)q[i].push_back({p[i]-k,p[i],ls[j-1],ls[j-1]+k});
        }
        if(nxt2[i]<=n){
            a=gets(p[nxt2[i]]-k),b=gets(p[nxt2[i]]);
            for(int j=b;j>=a;j--)q[i].push_back({p[i],p[i]+k,ls[j-1],ls[j-1]+k});
        }
    }
    sgt::reset(1,1,al);
    for(int i=n;i>=0;i--){
        for(int j=0;j<q[i].size();j++){
            int l1=gets(q[i][j].l1),r1=gets(q[i][j].r1),l2=gets(q[i][j].l2),r2=gets(q[i][j].r2);
            if(l1>l2)swap(l1,l2),swap(r1,r2);
            mp[i][q[i][j]]=min({sgt::gets(1,1,l1-1),sgt::gets(1,r1+1,l2-1),sgt::gets(1,r2+1,al)});
        }
        sgt::sets(1,gets(p[i]),i);
    }
    for(int i=0;i<=n;i++)rt[2*i]=tr::nw(),rt[2*i+1]=tr::nw();
    tr::sets(rt[1],1,0,1,al);
    for(int i=0;i<=n;i++){
        int a,b,c,d;
        if(nxt1[i]>n){
            for(int j=1;j<=al;j++)res=min(res,tr::gets(rt[2*i],j,1,al));
        }else{
            a=gets(p[nxt1[i]]-k),b=gets(p[nxt1[i]]),c=gets(p[i]-k),d=gets(p[i]);
            for(int j=b;j>=a;j--){
                int to=gets(i,p[i]-k,p[i],ls[j-1],ls[j-1]+k);
                if(to>n){
                    res=min(res,tr::gets(rt[2*i],j,1,al));
                    continue;
                }
                if(p[to]>p[i])tr::sets(rt[2*to],j,tr::gets(rt[2*i],j,1,al)+p[to]-p[i],1,al);
                else tr::sets(rt[2*to+1],j,tr::gets(rt[2*i],j,1,al)+p[i]-p[to]-k,1,al);
                if(ls[j-1]<p[to])tr::sets(rt[2*to],c,tr::gets(rt[2*i],j,1,al)+p[to]-ls[j-1]-k,1,al);
                else tr::sets(rt[2*to+1],c,tr::gets(rt[2*i],j,1,al)+ls[j-1]-p[to],1,al);
            }
            tr::sets(rt[2*nxt1[i]],c,tr::gets1(rt[2*i],1,a-1,1,al)+p[nxt1[i]]-k,1,al);
            tr::sets(rt[2*nxt1[i]+1],c,tr::gets2(rt[2*i],b+1,n,1,al)-p[nxt1[i]],1,al);
            if(p[nxt1[i]]>p[i]){
                tr::add(rt[2*i],p[nxt1[i]]-p[i]);
                tr::hb(rt[2*nxt1[i]],rt[2*i],1,al);
            }else{
                tr::add(rt[2*i],p[i]-p[nxt1[i]]-k);
                tr::hb(rt[2*nxt1[i]+1],rt[2*i],1,al);
            }
        }
        if(nxt2[i]>n){
            for(int j=1;j<=al;j++)res=min(res,tr::gets(rt[2*i+1],j,1,al));
        }else{
            a=gets(p[nxt2[i]]-k),b=gets(p[nxt2[i]]),c=gets(p[i]),d=gets(p[i]+k);
            for(int j=b;j>=a;j--){
                int to=gets(i,p[i],p[i]+k,ls[j-1],ls[j-1]+k);
                if(to>n){
                    res=min(res,tr::gets(rt[2*i+1],j,1,al));
                    continue;
                }
                if(p[to]>p[i])tr::sets(rt[2*to],j,tr::gets(rt[2*i+1],j,1,al)+p[to]-p[i]-k,1,al);
                else tr::sets(rt[2*to+1],j,tr::gets(rt[2*i+1],j,1,al)+p[i]-p[to],1,al);
                if(ls[j-1]<p[to])tr::sets(rt[2*to],c,tr::gets(rt[2*i+1],j,1,al)+p[to]-ls[j-1]-k,1,al);
                else tr::sets(rt[2*to+1],c,tr::gets(rt[2*i+1],j,1,al)+ls[j-1]-p[to],1,al);
            }
            tr::sets(rt[2*nxt2[i]],c,tr::gets1(rt[2*i+1],1,a-1,1,al)+p[nxt2[i]]-k,1,al);
            tr::sets(rt[2*nxt2[i]+1],c,tr::gets2(rt[2*i+1],b+1,al,1,al)-p[nxt2[i]],1,al);
            if(p[nxt2[i]]>p[i]){
                tr::add(rt[2*i+1],p[nxt2[i]]-p[i]-k);
                tr::hb(rt[2*nxt2[i]],rt[2*i+1],1,al);
            }else{
                tr::add(rt[2*i+1],p[i]-p[nxt2[i]]);
                tr::hb(rt[2*nxt2[i]+1],rt[2*i+1],1,al);
            }
        }
    }
    cout<<res;
}

详细

Subtask #1:

score: 15
Accepted

Test #1:

score: 15
Accepted
time: 3ms
memory: 18872kb

input:

200 20
78 30 163 87 97 53 96 76 81 138 156 200 124 93 173 119 115 93 150 99 22 80 88 131 61 126 47 103 143 142 129 186 89 105 101 143 178 110 13 77 79 178 21 108 200 146 87 105 54 61 136 69 161 195 13 105 18 151 25 191 30 35 90 110 17 98 181 58 120 102 139 71 59 24 72 84 33 12 28 82 23 80 128 96 115...

output:

3669

result:

ok single line: '3669'

Test #2:

score: 0
Accepted
time: 7ms
memory: 20360kb

input:

200 48
94 162 22 10 28 87 165 108 7 143 94 185 98 181 159 0 170 15 112 29 137 119 108 109 72 22 132 96 105 117 189 49 122 76 154 142 13 184 158 198 162 75 24 192 150 166 170 48 124 154 94 165 50 38 170 192 107 11 19 188 111 36 23 28 165 178 91 184 188 9 65 26 6 78 51 58 72 57 41 92 90 0 81 191 133 1...

output:

1665

result:

ok single line: '1665'

Test #3:

score: 0
Accepted
time: 4ms
memory: 18808kb

input:

200 6
129 31 73 103 93 174 111 45 59 173 87 61 41 146 86 60 84 95 126 149 164 190 42 10 113 153 51 33 7 191 64 165 200 139 20 81 140 196 40 155 166 78 77 162 150 59 93 174 137 62 32 42 155 42 176 185 136 101 52 178 68 168 160 141 27 141 182 197 29 43 52 3 59 101 27 148 129 183 160 178 40 83 26 37 61...

output:

5261

result:

ok single line: '5261'

Test #4:

score: 0
Accepted
time: 3ms
memory: 18284kb

input:

200 32
193 9 97 35 133 131 163 131 28 128 135 28 20 149 34 92 148 171 98 87 88 121 195 67 28 134 61 42 120 7 31 179 194 155 69 32 9 126 28 180 144 98 101 188 38 150 22 114 20 32 99 15 95 125 147 99 186 188 178 155 44 57 5 157 154 173 164 111 175 137 52 41 22 80 113 172 93 151 33 64 37 187 40 70 20 3...

output:

2919

result:

ok single line: '2919'

Test #5:

score: 0
Accepted
time: 0ms
memory: 20332kb

input:

200 45
193 39 78 169 128 182 91 182 21 15 37 177 144 184 193 79 85 126 35 135 29 62 176 25 164 42 150 174 170 110 113 147 15 46 158 122 195 139 188 170 28 107 45 147 46 171 0 180 67 66 194 54 9 6 33 115 183 119 132 83 165 56 124 178 90 68 30 185 60 105 31 139 36 10 112 13 70 168 38 5 194 42 170 37 7...

output:

1880

result:

ok single line: '1880'

Test #6:

score: 0
Accepted
time: 10ms
memory: 19028kb

input:

200 47
196 61 44 155 195 196 174 199 28 55 41 70 50 43 129 176 143 172 196 33 19 58 100 136 125 94 31 53 71 69 96 62 41 163 1 43 62 63 183 179 175 107 65 198 40 198 172 43 14 44 0 190 197 171 128 187 20 34 84 183 183 146 128 46 42 87 122 168 183 107 105 165 7 29 8 4 7 164 177 161 50 0 12 70 68 123 1...

output:

1473

result:

ok single line: '1473'

Test #7:

score: 0
Accepted
time: 6ms
memory: 18544kb

input:

200 14
191 73 156 161 162 165 168 165 174 44 41 34 60 18 18 18 112 166 71 71 10 20 19 29 137 147 148 69 37 40 42 32 178 118 183 193 183 171 93 100 27 29 37 28 22 14 26 186 147 161 158 8 10 12 6 3 190 107 127 127 124 115 122 159 155 157 44 63 114 114 114 116 124 76 151 137 77 9 198 5 5 17 185 179 178...

output:

2484

result:

ok single line: '2484'

Test #8:

score: 0
Accepted
time: 5ms
memory: 17516kb

input:

200 8
2 0 7 13 9 147 144 136 100 108 115 163 170 168 64 64 62 61 130 127 122 77 3 0 78 84 61 53 59 60 62 54 55 48 119 76 13 8 2 0 197 199 195 32 29 36 35 35 28 6 165 171 99 76 69 76 68 186 179 137 145 149 144 144 5 22 132 139 5 9 14 20 21 13 7 51 84 137 58 66 71 162 157 150 150 153 159 145 149 147 1...

output:

2616

result:

ok single line: '2616'

Test #9:

score: 0
Accepted
time: 4ms
memory: 20436kb

input:

200 37
195 162 181 5 182 151 176 158 121 115 168 167 147 76 92 127 184 150 192 21 58 34 14 21 34 81 91 95 34 53 61 45 192 182 194 193 171 188 10 59 31 29 170 44 74 37 4 18 195 28 6 182 184 73 101 114 10 175 195 21 21 6 178 7 196 146 163 175 182 186 160 123 148 157 187 171 134 179 179 194 194 163 169...

output:

1901

result:

ok single line: '1901'

Test #10:

score: 0
Accepted
time: 2ms
memory: 18124kb

input:

200 7
24 18 24 25 22 26 12 7 1 56 55 52 53 125 60 64 68 196 196 199 197 190 191 182 181 3 186 61 119 120 142 141 142 47 188 188 190 183 187 154 147 24 18 11 4 200 200 200 68 73 177 173 173 99 23 27 50 52 54 56 55 60 65 69 74 148 153 105 103 109 103 103 103 109 102 97 94 29 29 26 25 37 177 184 115 14...

output:

2257

result:

ok single line: '2257'

Test #11:

score: 0
Accepted
time: 7ms
memory: 18996kb

input:

192 19
99 102 103 96 95 106 93 92 109 90 89 88 87 86 85 116 117 118 81 80 121 78 123 76 125 126 127 128 129 130 69 68 133 134 135 136 63 138 139 60 141 58 57 144 55 146 147 148 149 50 151 152 153 46 155 44 43 158 41 40 39 38 163 164 165 34 167 168 169 30 29 28 173 174 25 24 23 22 21 180 19 18 17 16 ...

output:

457

result:

ok single line: '457'

Test #12:

score: 0
Accepted
time: 5ms
memory: 19092kb

input:

199 49
101 98 97 96 95 94 107 108 109 90 111 88 87 114 115 116 83 118 119 80 79 78 77 76 75 126 73 72 129 130 69 132 133 66 135 64 137 138 61 60 59 58 57 56 145 146 53 148 149 50 49 152 47 154 155 44 157 158 159 40 161 38 163 164 35 166 33 168 31 170 171 172 27 174 175 176 177 178 21 20 19 18 183 16...

output:

293

result:

ok single line: '293'

Test #13:

score: 0
Accepted
time: 11ms
memory: 20828kb

input:

194 45
100 101 99 102 98 103 97 104 96 105 95 106 94 107 93 108 92 109 91 110 90 111 89 112 88 113 87 114 86 115 85 116 84 117 83 118 82 119 81 120 80 121 79 122 78 123 77 124 76 125 75 126 74 127 73 128 72 129 71 130 70 131 69 132 68 133 67 134 66 135 65 136 64 137 63 138 62 139 61 140 60 141 59 14...

output:

212

result:

ok single line: '212'

Test #14:

score: 0
Accepted
time: 4ms
memory: 18984kb

input:

194 22
100 101 99 102 98 103 97 104 96 105 95 106 94 107 93 108 92 109 91 110 90 111 89 112 88 113 87 114 86 115 85 116 84 117 83 118 82 119 81 120 80 121 79 122 78 123 77 124 76 125 75 126 74 127 73 128 72 129 71 130 70 131 69 132 68 133 67 134 66 135 65 136 64 137 63 138 62 139 61 140 60 141 59 14...

output:

303

result:

ok single line: '303'

Test #15:

score: 0
Accepted
time: 6ms
memory: 20072kb

input:

199 28
1 199 2 198 3 197 4 196 5 195 6 194 7 193 8 192 9 191 10 190 11 189 12 188 13 187 14 186 15 185 16 184 17 183 18 182 19 181 20 180 21 179 22 178 23 177 24 176 25 175 26 174 27 173 28 172 29 171 30 170 31 169 32 168 33 167 34 166 35 165 36 164 37 163 38 162 39 161 40 160 41 159 42 158 43 157 4...

output:

313

result:

ok single line: '313'

Test #16:

score: 0
Accepted
time: 4ms
memory: 19832kb

input:

193 42
4 196 5 195 6 194 7 193 8 192 9 191 10 190 11 189 12 188 13 187 14 186 15 185 16 184 17 183 18 182 19 181 20 180 21 179 22 178 23 177 24 176 25 175 26 174 27 173 28 172 29 171 30 170 31 169 32 168 33 167 34 166 35 165 36 164 37 163 38 162 39 161 40 160 41 159 42 158 43 157 44 156 45 155 46 15...

output:

265

result:

ok single line: '265'

Test #17:

score: 0
Accepted
time: 6ms
memory: 19532kb

input:

197 39
96 95 106 107 92 91 90 89 88 87 86 115 84 83 82 81 80 79 78 77 124 125 74 127 128 129 70 69 68 67 66 135 136 63 138 61 60 141 58 143 56 55 54 147 52 51 150 151 48 153 46 45 156 43 42 159 40 161 38 37 36 35 166 33 168 31 170 171 28 27 26 25 24 23 22 21 180 19 182 183 184 185 186 187 188 11 10 ...

output:

347

result:

ok single line: '347'

Test #18:

score: 0
Accepted
time: 8ms
memory: 18260kb

input:

198 24
103 96 95 94 93 108 91 110 89 112 113 114 115 116 117 82 81 120 79 78 123 76 75 126 73 128 129 70 131 68 67 66 65 136 137 138 61 140 141 58 57 56 55 54 53 148 149 50 49 152 153 46 45 156 157 42 159 160 161 162 163 36 35 166 167 32 169 30 171 28 27 26 25 176 23 22 21 20 181 18 183 184 185 14 1...

output:

439

result:

ok single line: '439'

Subtask #2:

score: 0
Wrong Answer

Test #19:

score: 15
Accepted
time: 186ms
memory: 123720kb

input:

50000 0
957304147 455870042 888520405 388924006 685268286 213595280 898496267 50362797 310595209 105517171 706682592 663787741 927429771 306122736 1352192 453945549 31881610 943782347 779421515 543589796 209926777 908434673 845417119 374441290 190474943 606994057 30091060 491598457 644246786 4649716...

output:

7861788079227

result:

ok single line: '7861788079227'

Test #20:

score: 0
Accepted
time: 179ms
memory: 114356kb

input:

50000 0
267539818 976941407 232914453 134486565 946077774 327303661 383860856 427463180 82433525 829152030 323047687 114009885 572336732 324540200 312372486 904267355 354174716 897077585 726797234 14815480 56504568 128226636 908533574 690241784 234432089 60842581 4158447 140784062 814696061 27580609...

output:

7502844748010

result:

ok single line: '7502844748010'

Test #21:

score: 0
Accepted
time: 176ms
memory: 126436kb

input:

50000 0
113234313 300322176 223748251 154992665 988783374 705920968 587653430 735106433 339878986 23782050 772071399 43924374 333487655 112104185 388912725 30645653 230657785 50181507 210382459 974636263 84812430 683840330 470879024 352138490 544953829 857016921 83527213 679251552 204113040 48552509...

output:

7819216642612

result:

ok single line: '7819216642612'

Test #22:

score: 0
Accepted
time: 167ms
memory: 113852kb

input:

50000 0
57573834 735491176 585967317 50750966 13561867 538400010 923336660 411978534 229545007 608845964 778611980 433080482 340855878 525841885 436793984 121792438 646117967 157139578 341644163 71379300 980382262 841426801 263042095 570909388 241669384 780525526 306815843 529038526 677693926 272888...

output:

7502087871392

result:

ok single line: '7502087871392'

Test #23:

score: 0
Accepted
time: 207ms
memory: 123620kb

input:

50000 0
150529956 908563845 724316344 71839499 520290302 12371329 763161706 965762834 605485868 377855450 364159073 557572417 13573314 8085996 723464069 322060474 374561435 448408270 121729850 91335553 69989524 231531526 901985946 472906330 960997677 246590568 401537295 540808342 30457662 978645485 ...

output:

7655855679050

result:

ok single line: '7655855679050'

Test #24:

score: 0
Accepted
time: 174ms
memory: 113408kb

input:

50000 0
940144100 18386479 769788658 44738457 90257879 879207970 925016558 964597036 662771443 441833534 638630926 257398005 693370314 852807331 472327316 858562055 874978007 530679568 947674579 7081350 647463115 399061769 81471568 897044511 672282388 395480185 381093973 103836241 52060856 136053749...

output:

7329741440393

result:

ok single line: '7329741440393'

Test #25:

score: 0
Accepted
time: 190ms
memory: 123496kb

input:

50000 0
595877781 416920133 504115297 682623073 942495777 808743152 122852578 564363701 980818902 501483584 374724004 69557753 835258645 860520007 102814074 680949932 29792102 646922045 695269515 161539625 468996996 528287965 284414170 145379630 414176299 532680752 96308272 806611720 849878782 97734...

output:

7372386712114

result:

ok single line: '7372386712114'

Test #26:

score: 0
Accepted
time: 173ms
memory: 115092kb

input:

50000 0
236037002 215233133 41019240 229757515 806834959 849843304 862557844 39545138 297402862 7293515 880125105 285706647 152887583 198537021 740552834 3427605 366976152 641734017 106888137 154277089 259614856 518826105 796155721 132034997 420344028 702041117 117477828 821050418 113096425 2869065 ...

output:

7508382287165

result:

ok single line: '7508382287165'

Test #27:

score: 0
Accepted
time: 183ms
memory: 123292kb

input:

50000 0
428263671 324606118 736973623 961066097 320407929 663897387 328110400 789178775 344241539 34611323 77458169 730418405 89677130 456628708 735813218 665313790 99553725 408359166 161580926 95603740 537817168 587203140 239173276 980655467 73440384 209550435 242679387 923020102 447641965 71570611...

output:

7241590054407

result:

ok single line: '7241590054407'

Test #28:

score: 0
Accepted
time: 176ms
memory: 113688kb

input:

50000 0
848511669 673688847 134042037 382760566 86940474 283461772 923214109 543686174 579545679 713904091 366348707 242716930 5641588 704870794 542778347 296428822 959149832 495183306 649986132 551497587 550623110 591035272 204338017 214181048 891861232 524406707 448388519 594832891 610827442 93698...

output:

7606261035748

result:

ok single line: '7606261035748'

Test #29:

score: 0
Accepted
time: 194ms
memory: 123340kb

input:

50000 0
532965906 613164218 854565797 576587516 227406875 115434558 767691663 854474298 982611179 969491137 234543738 69267955 646968047 897911688 721008706 422527377 387136261 762884658 51918347 448273062 574144173 857719871 888425078 575352222 730868624 568669670 590036983 778842602 259437307 7201...

output:

7641479018806

result:

ok single line: '7641479018806'

Test #30:

score: 0
Accepted
time: 171ms
memory: 115100kb

input:

50000 0
950114012 924063984 78459732 2585137 167568618 422620546 817141675 939136111 912071559 28108367 138440975 401623398 614543476 413859636 583198666 7145092 692094019 896479223 265275914 14852033 553761091 831725889 256534067 178236755 434539705 610839223 807151106 140182765 324816595 576215181...

output:

7740448798710

result:

ok single line: '7740448798710'

Test #31:

score: 0
Accepted
time: 192ms
memory: 155532kb

input:

49983 0
500000001 500000002 500000003 500000004 500000005 499999994 499999993 499999992 500000009 500000010 499999989 500000012 499999987 499999986 499999985 500000016 500000017 500000018 500000019 500000020 500000021 499999978 500000023 500000024 500000025 499999974 499999973 500000028 500000029 50...

output:

1000099953

result:

ok single line: '1000099953'

Test #32:

score: 0
Accepted
time: 188ms
memory: 155200kb

input:

49993 0
499999999 500000002 499999997 500000004 500000005 500000006 500000007 499999992 500000009 500000010 500000011 500000012 500000013 499999986 500000015 499999984 500000017 500000018 500000019 500000020 499999979 499999978 500000023 499999976 500000025 499999974 500000027 500000028 500000029 50...

output:

1000099975

result:

ok single line: '1000099975'

Test #33:

score: -15
Wrong Answer
time: 193ms
memory: 155668kb

input:

49973 0
500049973 499950028 500049971 499950030 500049969 499950032 499950033 500049966 499950035 499950036 499950037 500049962 499950039 499950040 499950041 499950042 499950043 499950044 500049955 500049954 500049953 499950048 500049951 499950050 499950051 500049948 500049947 499950054 499950055 50...

output:

1000299825

result:

wrong answer 1st lines differ - expected: '1000099943', found: '1000299825'

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #3:

0%