Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
54335 | zhangweiran | 向量点积计算 | C++ | Accepted | 1 MS | 256 KB | 330 | 2024-10-27 10:40:44 |
#include<bits/stdc++.h> using namespace std; int main(){ int n, sum = 0; cin >> n; int a[n], b[n]; for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ cin >> b[i]; } for(int i = 0; i < n; i++){ sum += a[i]*b[i]; } cout << sum; return 0; }