답안 #844702

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
844702 2023-09-05T17:18:17 Z konber Rack (eJOI19_rack) C++14
40 / 100
1 ms 600 KB
#include <iostream>
#include <cmath>

using namespace std;
typedef long long ll;

int main()
{
    ll n; ll k;
    scanf("%lld%lld", &n, &k);
    ll first=1, last, mid;
    
    if(n > 60) last = pow(10, 18);
    else last = pow(2, n);
    
    k--;
    while(first != last){
        mid = (first+last)/2;
        if(k%2==0){
            last = mid;
            k /= 2;
        }
        else{
            first = mid+1;
            k /= 2;
        }
    }

    ll mod=1e9+7;
    printf("%lld\n", first%mod);
}

Compilation message

rack.cpp: In function 'int main()':
rack.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%lld%lld", &n, &k);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 344 KB Output is correct
11 Correct 1 ms 600 KB Output is correct
12 Incorrect 0 ms 348 KB Output isn't correct
13 Halted 0 ms 0 KB -