QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#164104#4274. $2x + 2$wsyearWA 18ms9232kbPython3104b2023-09-04 19:53:352023-09-04 19:53:36

Judging History

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

  • [2023-09-04 19:53:36]
  • 评测
  • 测评结果:WA
  • 用时:18ms
  • 内存:9232kb
  • [2023-09-04 19:53:35]
  • 提交

answer

n = int(input())
ans = 0
coe = 1
while n != 0:
  ans += coe * n
  coe = -coe
  n //= 2
print(ans)

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 13ms
memory: 9168kb

input:

4

output:

3

result:

ok answer is '3'

Test #2:

score: 0
Accepted
time: 18ms
memory: 9092kb

input:

10000000000

output:

6666666667

result:

ok answer is '6666666667'

Test #3:

score: 0
Accepted
time: 14ms
memory: 9168kb

input:

11537

output:

7692

result:

ok answer is '7692'

Test #4:

score: 0
Accepted
time: 17ms
memory: 9040kb

input:

41309

output:

27540

result:

ok answer is '27540'

Test #5:

score: 0
Accepted
time: 9ms
memory: 9088kb

input:

8191927142339937565554845978095081242540169480073285738552305926582959325059543812213073905385467089

output:

5461284761559958377036563985396720828360112986715523825701537284388639550039695874808715936923644727

result:

ok answer is '546128476155995837703656398539...9550039695874808715936923644727'

Test #6:

score: 0
Accepted
time: 17ms
memory: 9232kb

input:

3442352750904517878505619138601923704219437640757539618101640600496556715434957688100692603387053285

output:

2294901833936345252337079425734615802812958427171693078734427066997704476956638458733795068924702192

result:

ok answer is '229490183393634525233707942573...4476956638458733795068924702192'

Test #7:

score: 0
Accepted
time: 17ms
memory: 9040kb

input:

1613323280652897219227411721866100145041476611268669226074320085219149805106782606494134047806758188

output:

1075548853768598146151607814577400096694317740845779484049546723479433203404521737662756031871172125

result:

ok answer is '107554885376859814615160781457...3203404521737662756031871172125'

Test #8:

score: -100
Wrong Answer
time: 13ms
memory: 9168kb

input:

5315968240892751432719450950079352483724763602617515777985835699795112297723617975471814602589260139

output:

3543978827261834288479633966719568322483175735078343851990557133196741531815745316981209735059506755

result:

wrong answer expected '354397882726183428847963396671...1531815745316981209735059506756', found '354397882726183428847963396671...1531815745316981209735059506755'