ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#170299 | #1110. 奇数和 | luojianwei2216 | 100 | 1ms | 1196kb | C++ | 219b | 2023-04-01 21:49:00 | 2023-04-01 21:49:02 |
answer
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, m;
long long ans = 0;
cin >> n >> m;
if(n % 2 == 0) n += 1;
for(int i = n; i <= m; i += 2) {
ans += i;
}
cout << ans;
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 20
Accepted
time: 1ms
memory: 1192kb
input:
48 517
output:
66505
result:
ok single line: '66505'
Test #2:
score: 20
Accepted
time: 0ms
memory: 1196kb
input:
44 844
output:
177600
result:
ok single line: '177600'
Test #3:
score: 20
Accepted
time: 0ms
memory: 1192kb
input:
45 546
output:
74045
result:
ok single line: '74045'
Test #4:
score: 20
Accepted
time: 0ms
memory: 1192kb
input:
18 1093
output:
299128
result:
ok single line: '299128'
Test #5:
score: 20
Accepted
time: 0ms
memory: 1196kb
input:
38 142
output:
4680
result:
ok single line: '4680'