UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#170448#1246. 合数的因子luojianwei22161001ms1200kbC++258b2023-04-29 18:02:072023-04-29 18:02:08

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	for(int i = 1; i <= sqrt(n); i++) {
		if(n % i == 0) cout << i << ' ';
	}
	for(int i = sqrt(n) + 1; i <= n; i++) {
		if(n % i == 0) cout << i << ' ';
	}
	return 0;
}

详细

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

Test #1:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

12

output:

1 2 3 4 6 12 

result:

ok single line: '1 2 3 4 6 12 '

Test #2:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

7

output:

1 7 

result:

ok single line: '1 7 '

Test #3:

score: 10
Accepted
time: 1ms
memory: 1200kb

input:

1

output:

1 

result:

ok single line: '1 '

Test #4:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

4

output:

1 2 4 

result:

ok single line: '1 2 4 '

Test #5:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

15

output:

1 3 5 15 

result:

ok single line: '1 3 5 15 '

Test #6:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

46

output:

1 2 23 46 

result:

ok single line: '1 2 23 46 '

Test #7:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

67

output:

1 67 

result:

ok single line: '1 67 '

Test #8:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

789

output:

1 3 263 789 

result:

ok single line: '1 3 263 789 '

Test #9:

score: 10
Accepted
time: 0ms
memory: 1200kb

input:

453

output:

1 3 151 453 

result:

ok single line: '1 3 151 453 '

Test #10:

score: 10
Accepted
time: 0ms
memory: 1196kb

input:

42

output:

1 2 3 6 7 14 21 42 

result:

ok single line: '1 2 3 6 7 14 21 42 '