QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#85533#5359. 面国建设xiaoyaowudi6 2ms3568kbC++14431b2023-03-07 20:38:172023-03-07 20:39:17

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-07 20:39:17]
  • 评测
  • 测评结果:6
  • 用时:2ms
  • 内存:3568kb
  • [2023-03-07 20:38:17]
  • 提交

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%