# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
439626 | 2021-06-30T11:35:24 Z | LucaIlie | Rack (eJOI19_rack) | C | 8 ms | 4172 KB |
#include <stdio.h> #define MAX_N 1000000 #define MAX_LG 62 #define MOD 1000000007 int p2mod[MAX_N + 1]; long long p2[MAX_LG + 1]; int main() { int n, r, i; long long k; scanf( "%d%lld", &n, &k ); k--; p2[0] = 1; for ( i = 1; i <= MAX_LG; i++ ) p2[i] = p2[i - 1] * 2; p2mod[0] = 1; for ( i = 1; i <= MAX_N; i++ ) p2mod[i] = (p2mod[i - 1] * 2) % MOD; r = 0; for ( i = MAX_LG; i >= 0; i-- ) { if ( (k / p2[i]) % 2 == 1 ) r = (r + p2mod[n - 1 - i]) % MOD; } printf( "%d", r + 1 ); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 4172 KB | Output is correct |
2 | Correct | 7 ms | 4172 KB | Output is correct |
3 | Correct | 8 ms | 4172 KB | Output is correct |
4 | Correct | 6 ms | 4172 KB | Output is correct |
5 | Correct | 7 ms | 4172 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 4172 KB | Output is correct |
2 | Correct | 7 ms | 4172 KB | Output is correct |
3 | Correct | 8 ms | 4172 KB | Output is correct |
4 | Correct | 6 ms | 4172 KB | Output is correct |
5 | Correct | 7 ms | 4172 KB | Output is correct |
6 | Correct | 6 ms | 4172 KB | Output is correct |
7 | Correct | 6 ms | 4172 KB | Output is correct |
8 | Correct | 7 ms | 4172 KB | Output is correct |
9 | Correct | 6 ms | 4172 KB | Output is correct |
10 | Correct | 7 ms | 4076 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 4172 KB | Output is correct |
2 | Correct | 7 ms | 4172 KB | Output is correct |
3 | Correct | 8 ms | 4172 KB | Output is correct |
4 | Correct | 6 ms | 4172 KB | Output is correct |
5 | Correct | 7 ms | 4172 KB | Output is correct |
6 | Correct | 6 ms | 4172 KB | Output is correct |
7 | Correct | 6 ms | 4172 KB | Output is correct |
8 | Correct | 7 ms | 4172 KB | Output is correct |
9 | Correct | 6 ms | 4172 KB | Output is correct |
10 | Correct | 7 ms | 4076 KB | Output is correct |
11 | Correct | 7 ms | 4172 KB | Output is correct |
12 | Correct | 7 ms | 4084 KB | Output is correct |
13 | Correct | 6 ms | 4172 KB | Output is correct |
14 | Correct | 6 ms | 4172 KB | Output is correct |
15 | Correct | 6 ms | 4172 KB | Output is correct |