5 solutions

  • 0
    @ 2026-2-3 10:06:04

    cpp, #include<bits/stdc++.h> using namespace std; int main() { int a,b,c,k=0; cin>>a>>b; for(int i=1;i<=b;i++) { cin>>c; if(c<=a) { a=a-c; } else { k=k+1; }

    }
    cout<<k;
    return 0;
    

    }

    Information

    ID
    880
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    215
    Accepted
    85
    Uploaded By