QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#672628 | #6976. Hanging Rack | KiharaTouma | 40 | 1ms | 3876kb | C++14 | 350b | 2024-10-24 17:52:14 | 2024-10-24 17:52:15 |
Judging History
answer
//qoj6976
#include <bits/stdc++.h>
using namespace std;
int n;
long long k;
int main(){
scanf("%d%lld", &n, &k);
-- k;
long long ans = 0;
for(int i = 0; i < n; ++ i){
if((k >> i) & 1){
ans += 1 << (n - i - 1);
}
}
++ ans;
printf("%lld\n", ans % 1000000007);
return 0;
}
详细
Subtask #1:
score: 20
Accepted
Test #1:
score: 20
Accepted
time: 1ms
memory: 3740kb
input:
3 2
output:
5
result:
ok 1 number(s): "5"
Test #2:
score: 20
Accepted
time: 0ms
memory: 3840kb
input:
5 6
output:
21
result:
ok 1 number(s): "21"
Test #3:
score: 20
Accepted
time: 0ms
memory: 3860kb
input:
6 31
output:
31
result:
ok 1 number(s): "31"
Test #4:
score: 20
Accepted
time: 0ms
memory: 3876kb
input:
7 65
output:
2
result:
ok 1 number(s): "2"
Test #5:
score: 20
Accepted
time: 0ms
memory: 3788kb
input:
9 284
output:
434
result:
ok 1 number(s): "434"
Subtask #2:
score: 20
Accepted
Dependency #1:
100%
Accepted
Test #6:
score: 20
Accepted
time: 0ms
memory: 3736kb
input:
11 176
output:
1961
result:
ok 1 number(s): "1961"
Test #7:
score: 20
Accepted
time: 0ms
memory: 3856kb
input:
13 3466
output:
4663
result:
ok 1 number(s): "4663"
Test #8:
score: 20
Accepted
time: 0ms
memory: 3744kb
input:
16 56635
output:
23740
result:
ok 1 number(s): "23740"
Test #9:
score: 20
Accepted
time: 0ms
memory: 3852kb
input:
18 162196
output:
206458
result:
ok 1 number(s): "206458"
Test #10:
score: 20
Accepted
time: 0ms
memory: 3864kb
input:
20 214181
output:
152109
result:
ok 1 number(s): "152109"
Subtask #3:
score: 0
Wrong Answer
Dependency #1:
100%
Accepted
Dependency #2:
100%
Accepted
Test #11:
score: 0
Wrong Answer
time: 0ms
memory: 3872kb
input:
42 565922676
output:
266029365
result:
wrong answer 1st numbers differ - expected: '203957466', found: '266029365'