242672026-02-07 16:40:20ercseferencSzitakötő (50 pont)cpp17Wrong answer 0/502ms552 KiB
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main()
{
    ll mod=1e9+7;
    int n,m; cin>>n>>m; m--;
    /*if(n==3){
        ll x,y,z; cin>>x>>y>>z;
        if(m==0)cout<<0;
        if(m==1)if(x+y>z)cout<<4;else cout<<0;
        if(m==2)if(x+y<=z)cout<<8; else cout<<4;
        return 0;}
    vector<ll>s(n);
    cin>>s[0];
    for(int i=1; i<n; i++){
        ll x; cin>>x;
        s[i]=s[i-1]+x;}
    ll t=s[m]-s[m-1];
    int poz=m-1;
    while(t<s[poz] && poz>=0){
        t+=s[poz]-s[poz-1];
        poz--;}
    ll ans=1;
    poz++;
    for(int i=0; i<poz; i++)
        ans=(ans*2)%mod;
    vector<ll>dp(n);
    dp[m-1]=0;
    dp[m]=ans;
    bool leh=1;
    for(int i=m+1; i<n; i++){
        int x=m+1,y=i;
        if(2*s[i-1]<s[i])leh=0;
        while(leh && x!=y){
            int k=(x+y)/2;
            if(2*s[k-1]>s[i])y=k;
            else x=k+1;}
        dp[i]=(2*dp[i-1]-dp[x-2])%mod;
        if(dp[i]<0)dp[i]+=mod;}
    if(leh){
        dp[n-1]-=dp[n-2];
        dp[n-1]=(dp[n-1]*2)%mod;
        if(dp[n-1]<0)dp[n-1]+=mod;
        cout<<dp[n-1];}
    else cout<<0;*/
    if(n==2)return 0;
    ll s=0;
    for(int i=0; i<1000000; i++)
         for(int j=0; j<1000000; j++)s++;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/11ms316 KiB
4Wrong answer0/11ms316 KiB
5Wrong answer0/11ms316 KiB
6Wrong answer0/12ms552 KiB
7Wrong answer0/12ms316 KiB
8Wrong answer0/11ms352 KiB
9Wrong answer0/11ms316 KiB
10Wrong answer0/21ms332 KiB
11Wrong answer0/21ms508 KiB
12Wrong answer0/21ms544 KiB
13Wrong answer0/21ms316 KiB
14Wrong answer0/21ms316 KiB
15Wrong answer0/21ms316 KiB
16Wrong answer0/21ms508 KiB
17Wrong answer0/21ms316 KiB
18Wrong answer0/21ms316 KiB
19Wrong answer0/21ms316 KiB
20Wrong answer0/21ms316 KiB
21Wrong answer0/11ms316 KiB
22Wrong answer0/21ms508 KiB
23Wrong answer0/21ms316 KiB
24Wrong answer0/21ms316 KiB
25Wrong answer0/21ms316 KiB
26Wrong answer0/21ms500 KiB
27Wrong answer0/21ms316 KiB
28Wrong answer0/21ms316 KiB
29Wrong answer0/21ms316 KiB
30Wrong answer0/21ms316 KiB
31Wrong answer0/21ms316 KiB