QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#164106#4274. $2x + 2$wsyearWA 13ms8288kbPython3108b2023-09-04 19:54:482023-09-04 19:54:49

Judging History

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

  • [2023-09-04 19:54:49]
  • 评测
  • 测评结果:WA
  • 用时:13ms
  • 内存:8288kb
  • [2023-09-04 19:54:48]
  • 提交

answer

n = int(input())
ans = n % 2
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: 11ms
memory: 8088kb

input:

4

output:

3

result:

ok answer is '3'

Test #2:

score: 0
Accepted
time: 13ms
memory: 8164kb

input:

10000000000

output:

6666666667

result:

ok answer is '6666666667'

Test #3:

score: -100
Wrong Answer
time: 5ms
memory: 8288kb

input:

11537

output:

7693

result:

wrong answer expected '7692', found '7693'