###### tags: `CPE` # *2022/05/24 CPE_02* ## 題目:  ``` #include <iostream> #include <vector> using namespace std; int main() { int N; vector <long long>Female, Male; /*Initial Female & Male vector*/ Female.push_back(1); Male.push_back(0); while (cin >> N && N != -1) { while (N >= Male.size()) { long long Current_Female = Female.back(); long long Current_Male = Male.back(); Female.push_back(Current_Male+1); Male.push_back(Current_Female+Current_Male); } cout << Male[N] << " " << Male[N] + Female[N] << endl; } return 0; } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up