QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#672628#6976. Hanging RackKiharaTouma40 1ms3876kbC++14350b2024-10-24 17:52:142024-10-24 17:52:15

Judging History

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

  • [2024-10-24 17:52:15]
  • 评测
  • 测评结果:40
  • 用时:1ms
  • 内存:3876kb
  • [2024-10-24 17:52:14]
  • 提交

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;
}

Details

Tip: Click on the bar to expand more detailed information

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'