3 条题解

  • 0
    @ 2024-7-24 16:51:24
    #include <iostream>
    #include <vector>
     
    using namespace std;
     
    int main() {
        int n, m;
        cin >> n >> m;
     
        vector<int> currency(n);
        for (int i = 0; i < n; ++i) {
            cin >> currency[i];
        }
        vector<long long> dp(m + 1, 0);
        dp[0] = 1;  
        for (int i = 0; i < n; ++i) {
            for (int j = currency[i]; j <= m; ++j) {
                dp[j] += dp[j - currency[i]];
            }
        }
        cout << dp[m] << endl;
        return 0;
    }
    
    • 0
      @ 2024-7-24 16:50:38
      #include<iostream> #include<cstdio> #include<string> using namespace std; int main(){ freopen("shoujiin.txt","r",stdin); freopen("shoujiout。txt","w",stdout); string a,b; getline(cin,a); cout<<a<<endl; b = "abcdefghijklmnopqrstuvwxyz "; return 0; }
      
      • 0
        @ 2023-8-20 13:40:24

        #include #include #include using namespace std; int main(){ freopen("shoujiin.txt","r",stdin); freopen("shoujiout。txt","w",stdout); string a,b; getline(cin,a); cout<<a<<endl; b = "abcdefghijklmnopqrstuvwxyz "; return 0; }

        • 1

        信息

        ID
        425
        时间
        1000ms
        内存
        128MiB
        难度
        10
        标签
        递交数
        5
        已通过
        1
        上传者