ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#207915 | #3758. 拆分 | qiuqiu | 100 | 528ms | 1208kb | C++11 | 432b | 2024-08-01 09:44:17 | 2024-08-01 12:07:16 |
answer
#include <bits/stdc++.h>
using namespace std;
#define int long long
#pragma GCC optimize(2)
int f(int k){
int ans=0;
for(int i=1;i*i<=k;i++)
if(k%i==0){
ans+=2;
if(i*i==k) ans--;
}
return ans;
}
signed main(){
int n;
scanf("%lld",&n);
if(f(n-1)<=3){
cout<<1<<" "<<n-1;
return 0;
}
for(int i=3;i<=n/2;i+=2)
if(f(i)+f(n-i)<=4){
cout<<i<<" "<<n-i;
return 0;
}
return 0;
}
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1204kb
input:
92
output:
3 89
result:
ok ok, f(a)+f(b)=4
Test #2:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
88
output:
5 83
result:
ok ok, f(a)+f(b)=4
Test #3:
score: 10
Accepted
time: 1ms
memory: 1208kb
input:
74
output:
1 73
result:
ok ok, f(a)+f(b)=3
Test #4:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
99496
output:
149 99347
result:
ok ok, f(a)+f(b)=4
Test #5:
score: 10
Accepted
time: 1ms
memory: 1204kb
input:
97768
output:
191 97577
result:
ok ok, f(a)+f(b)=4
Test #6:
score: 10
Accepted
time: 0ms
memory: 1204kb
input:
70744
output:
137 70607
result:
ok ok, f(a)+f(b)=4
Test #7:
score: 10
Accepted
time: 54ms
memory: 1204kb
input:
101260118
output:
1039 101259079
result:
ok ok, f(a)+f(b)=4
Test #8:
score: 10
Accepted
time: 151ms
memory: 1204kb
input:
900200416
output:
977 900199439
result:
ok ok, f(a)+f(b)=4
Test #9:
score: 10
Accepted
time: 147ms
memory: 1204kb
input:
980144336
output:
883 980143453
result:
ok ok, f(a)+f(b)=4
Test #10:
score: 10
Accepted
time: 174ms
memory: 1200kb
input:
990429172
output:
1061 990428111
result:
ok ok, f(a)+f(b)=4
Extra Test:
score: 0
Extra Test Passed