8000 Create 2941.cpp · kwonja/basic-algo-lecture@38e883c · GitHub 10000
[go: up one dir, main page]

Skip to content

Commit 38e883c

Browse files
Create 2941.cpp
1 parent 34d787e commit 38e883c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Appendix A/2941.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// http://boj.kr/5295ed05414b482692b3eb2e0a9c2a42
2+
#include <bits/stdc++.h>
3+
using namespace std;
4+
5+
vector<string> alphas = {"c=", "c-", "dz=", "d-", "lj", "nj", "s=", "z="};
6+
7+
int main(void) {
8+
ios::sync_with_stdio(0);
9+
cin.tie(0);
10+
string w;
11+
cin >> w;
12+
for(auto alpha : alphas){
13+
while(true){
14+
int pos = w.find(alpha);
15+
if(pos == string::npos) break;
16+
w.replace(pos, alpha.size(), "1");
17+
}
18+
}
19+
cout << w.size();
20+
}

0 commit comments

Comments
 (0)
0