UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#194764#1110. 奇数和yzgl1002ms1252kbC++209b2023-10-17 19:28:332023-10-17 19:28:34

answer

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios::sync_with_stdio(false);
	int n,m;
	cin>>n>>m;
	int s=0;
	for(int i=n;i<=m;i++){
		if(i%2==1){
			s+=i;
		}
	}
	cout<<s;
	return 0;
}

详细

小提示:点击横条可展开更详细的信息

Test #1:

score: 20
Accepted
time: 0ms
memory: 1252kb

input:

48 517

output:

66505

result:

ok single line: '66505'

Test #2:

score: 20
Accepted
time: 0ms
memory: 1252kb

input:

44 844

output:

177600

result:

ok single line: '177600'

Test #3:

score: 20
Accepted
time: 1ms
memory: 1248kb

input:

45 546

output:

74045

result:

ok single line: '74045'

Test #4:

score: 20
Accepted
time: 1ms
memory: 1248kb

input:

18 1093

output:

299128

result:

ok single line: '299128'

Test #5:

score: 20
Accepted
time: 0ms
memory: 1252kb

input:

38 142

output:

4680

result:

ok single line: '4680'