제출 #1099114

#제출 시각아이디문제언어결과실행 시간메모리
1099114vjudge1Rack (eJOI19_rack)C++17
40 / 100
1040 ms348 KiB
#include <iostream> #include <cmath> #include <vector> using namespace std; int main() { int height, node; cin >> height >> node; int rows = 1 << height; std::vector<int> path(height); for (int i = 0; i < node; ++i) { for (int j = 0; j < height; ++j) path[j] = (i >> j) & 1; } int leaf = 1; int set = pow(2, height); for (int i : path) { set = set/2; if (i == 1) leaf += set; } cout << leaf << endl; return 0; }

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

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