Skip to content

Commit de86bcf

Browse files
committed
[UPD] Add Implementation Solution
1 parent bf25c5e commit de86bcf

File tree

4 files changed

+64
-3
lines changed

4 files changed

+64
-3
lines changed

implementation/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
[백준 문제집](https://www.acmicpc.net/workbook/view/6783)
1818

19-
2019
| 순번 | 추천 문제 | 문제 이름 | 난이도 | 풀이 링크 |
2120
| :-----: | :-----: | :-----: | :-----: | :-----: |
2221
| 00 | :heavy_check_mark: | <a href="http://boj.kr/1212" target="_blank">8진수 2진수</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/2.svg"/> | <a href="./../solution/implementation/1212">바로가기</a> |
@@ -32,7 +31,7 @@
3231
| 10 | :heavy_check_mark: | <a href="http://boj.kr/1244" target="_blank">스위치 켜고 끄기</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/7.svg"/> | <a href="./../solution/implementation/1244">바로가기</a> |
3332
| 11 | :heavy_check_mark: | <a href="http://boj.kr/10994" target="_blank">별 찍기 - 19</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/7.svg"/> | <a href="./../solution/implementation/10994">바로가기</a> |
3433
| 12 | :heavy_check_mark: | <a href="http://boj.kr/20291" target="_blank">파일 정리</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/7.svg"/> | <a href="./../solution/implementation/20291">바로가기</a> |
35-
| 13 | :heavy_check_mark: | <a href="http://boj.kr/20436" target="_blank">ZOAC 3</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/7.svg"/> | |
34+
| 13 | :heavy_check_mark: | <a href="http://boj.kr/20436" target="_blank">ZOAC 3</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/7.svg"/> | <a href="./../solution/implementation/20436">바로가기</a> |
3635
| 14 | :heavy_check_mark: | <a href="http://boj.kr/16926" target="_blank">배열 돌리기 1</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/7.svg"/> | <a href="./../solution/implementation/16926">바로가기</a> |
3736
| 15 | :heavy_check_mark: | <a href="http://boj.kr/17413" target="_blank">단어 뒤집기 2</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/8.svg"/> | <a href="./../solution/implementation/17413">바로가기</a> |
3837
| 16 | :heavy_check_mark: | <a href="http://boj.kr/2615" target="_blank">오목</a> | <img height="25px" width="25px=" src="https://static.solved.ac/tier_small/8.svg"/> | |

implementation/list.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
1,별 찍기 - 19,10994,s4,./../solution/implementation/10994
1616
,할아버지는 유명해!,5766,s4,
1717
1,파일 정리,20291,s4,./../solution/implementation/20291
18-
1,ZOAC 3,20436,s4,
18+
1,ZOAC 3,20436,s4,./../solution/implementation/20436
1919
1,단어 뒤집기 2,17413,s3,./../solution/implementation/17413
2020
1,오목,2615,s3,
2121
,이진수 덧셈,2729,s3,
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#include<bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
const string qwerty[3] = {"qwertyuiop", "asdfghjkl", "zxcvbnm"};
6+
const string OnlyLeft = "qwertasdfgzxcv";
7+
int X[33], Y[33];
8+
9+
bool isLeft(char x){ return OnlyLeft.find(x) != string::npos; }
10+
int dist(char a, char b){return abs(Y[a-'a']-Y[b-'a']) + abs(X[a-'a']-X[b-'a']); }
11+
12+
int main(){
13+
ios::sync_with_stdio(false);
14+
cin.tie(0);
15+
16+
for(int i=0;i<3;i++){
17+
for(int j=0;j<(int)qwerty[i].size();j++){
18+
Y[qwerty[i][j] - 'a'] = i;
19+
X[qwerty[i][j] - 'a'] = j;
20+
}
21+
}
22+
23+
char L, R; cin >> L >> R;
24+
string word; cin >> word;
25+
26+
int answer = 0;
27+
for(auto &w: word){
28+
if(isLeft(w)) {
29+
answer += dist(L, w) + 1;
30+
L = w;
31+
}
32+
else {
33+
answer += dist(R, w) + 1;
34+
R = w;
35+
}
36+
}
37+
cout << answer;
38+
39+
return 0;
40+
}
41+

solution/implementation/2615/main.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#include<bits/stdc++.h>
2+
3+
using namespace std;
4+
5+
const int dy[] = {-1,1,0,0,-1,-1,1,1};
6+
const int dx[] = {0,0,-1,1,-1,1,-1,1};
7+
8+
int main(){
9+
ios::sync_with_stdio(false);
10+
cin.tie(0);
11+
12+
const int N = 19;
13+
14+
for(int i=0;i<N;i++){
15+
for(int j=0;j<N;j++){
16+
17+
}
18+
}
19+
20+
return 0;
21+
}

0 commit comments

Comments
 (0)