QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#85533 | #5359. 面国建设 | xiaoyaowudi | 6 | 2ms | 3568kb | C++14 | 431b | 2023-03-07 20:38:17 | 2023-03-07 20:39:17 |
Judging History
answer
#include <iostream>
#include <algorithm>
constexpr int N(6010),inf(1e9);
int f[N];
int main()
{
int S,C;std::cin>>S>>C;C/=2;
std::fill(f+1,f+S+1,inf);
for(int i(1);i<=S;++i) for(int j(1);j*i<=S;++j) f[i*j]=std::min(f[i*j],i+j);
int ans(0);
for(int i(1);i<=S;++i)
{
for(int j(1);j<i;++j) f[i]=std::min(f[i],f[j]+f[i-j]);
ans+=std::max(0,std::min(C,i*2)-f[i]+1);
}
std::cout<<ans<<std::endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 6
Accepted
Test #1:
score: 6
Accepted
time: 2ms
memory: 3396kb
input:
4 10
output:
7
result:
ok single line: '7'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3340kb
input:
7 2
output:
0
result:
ok single line: '0'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
6 6
output:
2
result:
ok single line: '2'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
10 7
output:
2
result:
ok single line: '2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3392kb
input:
8 10
output:
8
result:
ok single line: '8'
Test #6:
score: 0
Accepted
time: 2ms
memory: 3568kb
input:
10 8
output:
5
result:
ok single line: '5'
Subtask #2:
score: 0
Wrong Answer
Dependency #1:
100%
Accepted
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 3568kb
input:
399 994
output:
125688
result:
wrong answer 1st lines differ - expected: '125266', found: '125688'
Subtask #3:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #1:
100%
Accepted
Dependency #2:
0%