| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 51640 | 张思存 | 奇数求和 | C++ | Wrong Answer | 0 MS | 256 KB | 376 | 2024-09-23 07:04:12 |
#include<bits/stdc++.h> using namespace std; int main() { int m, n, sum, a; cin >> m >> n; sum = 0; if(m % 2 == 1){ for(int i = m;i <= n-1+n%2;i+=2){ cin >> a; sum += a; } }else{ for(int i = m+1;i <= n-1+n%2;i+=2){ cin >> a; sum += a; } }cout << sum; return 0; }