1 条题解

  • 1
    @ 2025-2-15 10:29:55
    #include <iostream>
    #include <vector>
    using namespace std;
    vector<int> a , b;
    int main(){
       int n , tmp;
       cin >> n;
       for(int i = 0; i < n; i++){
          cin >> tmp;
          a.push_back(tmp);
       }
       for(int i = 0; i < n; i++){
          cin >> tmp;
          b.push_back(tmp);
       }
       int ans = 0;
       for(int i = 0; i < n; i++){
          ans = ans + a[i] * b[i];
       }\
       cout << ans;
    
     
    
    
       
    
    
    
    
       return 0;
    }
    
    • 1

    信息

    ID
    395
    时间
    1000ms
    内存
    64MiB
    难度
    10
    标签
    递交数
    3
    已通过
    3
    上传者