8000 Merge pull request #51 from Hot6Maina/patch-17 · twinkite/basic-algo-lecture@d33255f · GitHub
[go: up one dir, main page]

Skip to content

Commit d33255f

Browse files
Merge pull request encrypted-def#51 from Hot6Maina/patch-17
Update 2193.cpp
2 parents 1f3f9f1 + 5de993f commit d33255f

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

0x10/solutions/2193.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
// Authored by : BaaaaaaaaaaarkingDog
1+
// Authored by : Hot6Mania
22
// Co-authored by : -
3-
// http://boj.kr/****************
3+
// http://boj.kr/62b94c1ad9254f87a1f6e37323f2c5bf
44
#include <bits/stdc++.h>
55
using namespace std;
66

7+
typedef long long ll;
8+
9+
int n;
10+
ll d[100][2];
11+
712
int main(void){
813
ios::sync_with_stdio(0);
914
cin.tie(0);
1015

11-
}
16+
cin >> n;
17+
d[1][1] = 1LL;
18+
for(int i = 2; i <= n; ++i){
19+
d[i][0] = d[i-1][0] + d[i-1][1];
20+
d[i][1] = d[i-1][0];
21+
}
22+
cout << d[n][0] + d[n][1];
23+
}

0 commit comments

Comments
 (0)
0