1 条题解

  • 2
    @ 2026-6-4 22:44:02
    #include <bits/stdc++.h>
    using namespace std;
    int main() {
     int m, n;
        cin >> m;
        cin >> n;
        int f = 0;
        for(int i = 0; i < n; i++)
        {
            int n;
            cin >> n;
            if(n > m)
            {
                f++; 
            }
            else
            {
                m -= n; 
            }
        }
        cout << f;
        return 0;
    }
    
    
    

    信息

    ID
    30961
    时间
    1000ms
    内存
    256MiB
    难度
    3
    标签
    (无)
    递交数
    50
    已通过
    27
    上传者