ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#207840 | #3758. 拆分 | wsh0220 | 100 | 2ms | 1200kb | C++ | 278b | 2024-08-01 08:46:18 | 2024-08-01 12:02:13 |
answer
#include <bits/stdc++.h>
using namespace std;
bool prime(int x)
{
for(int i=2;i*i<=x;i++)
if(x%i==0)
return 0;
return 1;
}
int n;
int main()
{
cin>>n;
for(int i=1;i+i<=n;i++)
{
if(prime(i)&&prime(n-i))
cout<<i<<" "<<n-i,exit(0);
}
return 0;
}
Details
小提示:点击横条可展开更详细的信息
Test #1:
score: 10
Accepted
time: 0ms
memory: 1196kb
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: 0ms
memory: 1200kb
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: 1196kb
input:
97768
output:
191 97577
result:
ok ok, f(a)+f(b)=4
Test #6:
score: 10
Accepted
time: 0ms
memory: 1196kb
input:
70744
output:
137 70607
result:
ok ok, f(a)+f(b)=4
Test #7:
score: 10
Accepted
time: 1ms
memory: 1196kb
input:
101260118
output:
1039 101259079
result:
ok ok, f(a)+f(b)=4
Test #8:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
900200416
output:
977 900199439
result:
ok ok, f(a)+f(b)=4
Test #9:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
980144336
output:
883 980143453
result:
ok ok, f(a)+f(b)=4
Test #10:
score: 10
Accepted
time: 0ms
memory: 1200kb
input:
990429172
output:
1061 990428111
result:
ok ok, f(a)+f(b)=4
Extra Test:
score: 0
Extra Test Passed