242942026-02-08 12:03:28szjSzitakötő (50 pont)cpp17Wrong answer 3/5017ms1192 KiB
#include <bits/stdc++.h>
#define ll long long
#define blugy %1000000007
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    //ifstream cin("f.txt");
    ll n, k, i, mer, mar=0, sum=1;
    cin >> n >> k;
    k--;
    ll t[n];
    for(i=0; i<n; i++)cin >> t[i];
    for(i=0; i<k; i++)mar+=t[i];
    for(i=k-1; i>=0 && t[k]<mar; i--)
    {
        mar-=t[i];
        t[k]+=t[i];
    }
    t[k]+=mar;
    mar=0;
    for(i; i>=0; i--)sum=(sum<<1)blugy;
    for(i=k+1; i<n; i++)mar+=t[i];
    for(i=k+1; i<n && t[k]<mar; i++)
    {
        mar-=t[i];
        t[k]+=t[i];
    }
    for(i; i<n; i++)sum=(sum<<1)blugy;
    cout << sum;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Accepted0/01ms316 KiB
2Wrong answer0/017ms1076 KiB
3Wrong answer0/11ms316 KiB
4Accepted1/11ms316 KiB
5Wrong answer0/11ms316 KiB
6Wrong answer0/11ms316 KiB
7Wrong answer0/11ms316 KiB
8Wrong answer0/11ms316 KiB
9Wrong answer0/11ms316 KiB
10Wrong answer0/21ms316 KiB
11Wrong answer0/21ms316 KiB
12Wrong answer0/21ms316 KiB
13Wrong answer0/21ms316 KiB
14Accepted2/21ms316 KiB
15Wrong answer0/21ms316 KiB
16Wrong answer0/22ms316 KiB
17Wrong answer0/22ms500 KiB
18Wrong answer0/22ms316 KiB
19Wrong answer0/22ms316 KiB
20Wrong answer0/21ms316 KiB
21Wrong answer0/11ms332 KiB
22Wrong answer0/212ms1176 KiB
23Wrong answer0/213ms1120 KiB
24Wrong answer0/216ms1192 KiB
25Wrong answer0/217ms1084 KiB
26Wrong answer0/217ms1068 KiB
27Wrong answer0/28ms972 KiB
28Wrong answer0/213ms1160 KiB
29Wrong answer0/213ms976 KiB
30Wrong answer0/217ms1188 KiB
31Wrong answer0/216ms1172 KiB