제출 #1099203

#제출 시각아이디문제언어결과실행 시간메모리
1099203vjudge1Rack (eJOI19_rack)C++17
40 / 100
1 ms456 KiB
#include <algorithm> #include <iostream> #include <bits/stdc++.h> #include <cmath> #include <vector> using namespace std; const long long mod = 1e9+7; int binary_exponentiation(int number, int exponent) { int result = 1; while (exponent > 0) { if(exponent & 1) result = result * number; number = number * number; exponent >>= 1; } return result; } int make_path(long long seed, int length) { long long path = 0; for (int i = 0; i < length; i++) { if (((seed >> i) & 1) == 1) path = (path + binary_exponentiation(2, length - i - 1))%mod; } return path; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int height, node; cin >> height >> node; int rows = 1 << height; cout << (make_path(node - 1, height) + 1)%mod << endl; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

rack.cpp: In function 'int main()':
rack.cpp:41:9: warning: unused variable 'rows' [-Wunused-variable]
   41 |     int rows = 1 << height;
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...