QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#493832#9158. 分数wangziji#0 237ms302048kbC++20631b2024-07-27 12:48:222024-07-27 12:48:23

Judging History

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

  • [2024-07-27 12:48:23]
  • 评测
  • 测评结果:0
  • 用时:237ms
  • 内存:302048kb
  • [2024-07-27 12:48:22]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
pair<int,int> q[50000005];
int l=1,r=0;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,m;
	cin >> n >> m;
	assert(n+n>=m);
//	for(int i=2;i<=max(n,m);i+=2)
//		q.push({1,i});
	q[++r]={0,1};
	int ans=0;
	while(l!=r+1)
	{
		pair<int,int> x=q[l];
		++l;
		int A=x.first,B=x.second;
		if(A<=n&&B<=m) ++ans;
		if(B<=n&&A<=m) ++ans;
		for(int i=A+2*B;i<=max(n,m);i+=2*B)
		{
			if(B+i*2<=max(n,m)) q[++r]={B,i};
			else
			{
				if(i<=n&&B<=m) ++ans;
				if(B<=n&&i<=m) ++ans;
			}
		}
	}
	cout << ans << "\n";
	return 0;
}
//63691 63691

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 0ms
memory: 3612kb

input:

99 99

output:

408

result:

wrong answer 1st numbers differ - expected: '406', found: '408'

Pretest #2:

score: 0
Wrong Answer
time: 0ms
memory: 3704kb

input:

98 97

output:

407

result:

wrong answer 1st numbers differ - expected: '405', found: '407'

Pretest #3:

score: 0
Wrong Answer
time: 0ms
memory: 3640kb

input:

99 96

output:

398

result:

wrong answer 1st numbers differ - expected: '396', found: '398'

Pretest #4:

score: 0
Wrong Answer
time: 0ms
memory: 3620kb

input:

995 977

output:

11155

result:

wrong answer 1st numbers differ - expected: '11153', found: '11155'

Pretest #5:

score: 0
Wrong Answer
time: 0ms
memory: 3652kb

input:

991 990

output:

11222

result:

wrong answer 1st numbers differ - expected: '11220', found: '11222'

Pretest #6:

score: 0
Wrong Answer
time: 0ms
memory: 3592kb

input:

976 968

output:

10902

result:

wrong answer 1st numbers differ - expected: '10900', found: '10902'

Pretest #7:

score: 0
Wrong Answer
time: 1ms
memory: 3896kb

input:

7602 7864

output:

215708

result:

wrong answer 1st numbers differ - expected: '215706', found: '215708'

Pretest #8:

score: 0
Wrong Answer
time: 1ms
memory: 3924kb

input:

7959 7735

output:

220258

result:

wrong answer 1st numbers differ - expected: '220256', found: '220258'

Pretest #9:

score: 0
Wrong Answer
time: 1ms
memory: 3988kb

input:

7878 7863

output:

221164

result:

wrong answer 1st numbers differ - expected: '221162', found: '221164'

Pretest #10:

score: 0
Wrong Answer
time: 1ms
memory: 3896kb

input:

7788 7658

output:

215325

result:

wrong answer 1st numbers differ - expected: '215323', found: '215325'

Pretest #11:

score: 0
Wrong Answer
time: 12ms
memory: 15228kb

input:

95399 99767

output:

8285297

result:

wrong answer 1st numbers differ - expected: '8285295', found: '8285297'

Pretest #12:

score: 0
Wrong Answer
time: 11ms
memory: 15128kb

input:

98051 99642

output:

8439715

result:

wrong answer 1st numbers differ - expected: '8439713', found: '8439715'

Pretest #13:

score: 0
Wrong Answer
time: 7ms
memory: 15768kb

input:

95624 96007

output:

8068129

result:

wrong answer 1st numbers differ - expected: '8068127', found: '8068129'

Pretest #14:

score: 0
Wrong Answer
time: 7ms
memory: 15376kb

input:

99208 98047

output:

8412612

result:

wrong answer 1st numbers differ - expected: '8412610', found: '8412612'

Pretest #15:

score: 0
Wrong Answer
time: 237ms
memory: 301916kb

input:

997417 967722

output:

229917325

result:

wrong answer 1st numbers differ - expected: '229917323', found: '229917325'

Pretest #16:

score: 0
Wrong Answer
time: 229ms
memory: 297936kb

input:

987807 956529

output:

226426914

result:

wrong answer 1st numbers differ - expected: '226426912', found: '226426914'

Pretest #17:

score: 0
Wrong Answer
time: 234ms
memory: 295752kb

input:

971654 984345

output:

228363807

result:

wrong answer 1st numbers differ - expected: '228363805', found: '228363807'

Pretest #18:

score: 0
Runtime Error

input:

7892259 7983727

output:


result:


Pretest #19:

score: 0
Runtime Error

input:

7937869 29796968

output:


result:


Pretest #20:

score: 0
Runtime Error

input:

29717543 29510173

output:


result:



Final Tests

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3688kb

input:

96 98

output:

398

result:

wrong answer 1st numbers differ - expected: '396', found: '398'

Test #2:

score: 0
Wrong Answer
time: 0ms
memory: 3556kb

input:

100 99

output:

410

result:

wrong answer 1st numbers differ - expected: '408', found: '410'

Test #3:

score: 0
Wrong Answer
time: 0ms
memory: 3628kb

input:

99 99

output:

408

result:

wrong answer 1st numbers differ - expected: '406', found: '408'

Test #4:

score: 0
Wrong Answer
time: 0ms
memory: 3724kb

input:

963 951

output:

10636

result:

wrong answer 1st numbers differ - expected: '10634', found: '10636'

Test #5:

score: 0
Wrong Answer
time: 0ms
memory: 3640kb

input:

958 974

output:

10797

result:

wrong answer 1st numbers differ - expected: '10795', found: '10797'

Test #6:

score: 0
Wrong Answer
time: 0ms
memory: 3608kb

input:

966 990

output:

11005

result:

wrong answer 1st numbers differ - expected: '11003', found: '11005'

Test #7:

score: 0
Wrong Answer
time: 1ms
memory: 3912kb

input:

7958 7947

output:

224484

result:

wrong answer 1st numbers differ - expected: '224482', found: '224484'

Test #8:

score: 0
Wrong Answer
time: 1ms
memory: 5884kb

input:

7623 7730

output:

213446

result:

wrong answer 1st numbers differ - expected: '213444', found: '213446'

Test #9:

score: 0
Wrong Answer
time: 1ms
memory: 3960kb

input:

7845 7783

output:

218918

result:

wrong answer 1st numbers differ - expected: '218916', found: '218918'

Test #10:

score: 0
Wrong Answer
time: 1ms
memory: 3924kb

input:

7881 7773

output:

219453

result:

wrong answer 1st numbers differ - expected: '219451', found: '219453'

Test #11:

score: 0
Wrong Answer
time: 7ms
memory: 15132kb

input:

99414 98698

output:

8465219

result:

wrong answer 1st numbers differ - expected: '8465217', found: '8465219'

Test #12:

score: 0
Wrong Answer
time: 11ms
memory: 14736kb

input:

98249 96148

output:

8237488

result:

wrong answer 1st numbers differ - expected: '8237486', found: '8237488'

Test #13:

score: 0
Wrong Answer
time: 7ms
memory: 16344kb

input:

99003 96832

output:

8324933

result:

wrong answer 1st numbers differ - expected: '8324931', found: '8324933'

Test #14:

score: 0
Wrong Answer
time: 11ms
memory: 15492kb

input:

98266 96030

output:

8231067

result:

wrong answer 1st numbers differ - expected: '8231065', found: '8231067'

Test #15:

score: 0
Wrong Answer
time: 212ms
memory: 288860kb

input:

968207 958885

output:

223522217

result:

wrong answer 1st numbers differ - expected: '223522215', found: '223522217'

Test #16:

score: 0
Wrong Answer
time: 230ms
memory: 302048kb

input:

959846 998397

output:

228770875

result:

wrong answer 1st numbers differ - expected: '228770873', found: '228770875'

Test #17:

score: 0
Wrong Answer
time: 194ms
memory: 289952kb

input:

965821 972280

output:

225359212

result:

wrong answer 1st numbers differ - expected: '225359210', found: '225359212'

Test #18:

score: 0
Runtime Error

input:

7855098 7962479

output:


result:


Test #19:

score: 0
Runtime Error

input:

7841076 29648718

output:


result:


Test #20:

score: 0
Runtime Error

input:

29365129 29012208

output:


result: