QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#544126 | #4274. $2x + 2$ | kuaiqujuan | Compile Error | / | / | C++14 | 122b | 2024-09-02 09:58:06 | 2024-09-02 09:58:06 |
Judging History
answer
n = int(input())
n += 2
ans = -1
coef = 1
while n > 0 :
ans += n * coef
n //= 2
coef *= -1;
print(ans)
Details
answer.code:1:1: error: ‘n’ does not name a type 1 | n = int(input()) | ^ answer.code:9:6: error: expected constructor, destructor, or type conversion before ‘(’ token 9 | print(ans) | ^