제출 #1166017

#제출 시각아이디문제언어결과실행 시간메모리
1166017novemnotesIntercastellar (JOI22_ho_t1)C++20
0 / 100
2 ms320 KiB
#include <bits/stdc++.h> using namespace std; int n; vector<int> ans; int solve(int x){ if(x%2==1)ans.push_back(x); else for(int i=0;i<2;i++)solve(x/2); } int main(){ cin.tie(nullptr)->sync_with_stdio(false); cin >> n; while(n--){ int x;cin >> x; solve(x); } int q;cin >> q; while(q--){ int x;cin >> x; x--; cout << ans[x] << "\n"; } return 0; }

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

Main.cpp: In function 'int solve(int)':
Main.cpp:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...