Skip to content

Commit 2bf52a4

Browse files
committedJan 21, 2022
Solve 16673, 21965, 1543
1 parent f79f15c commit 2bf52a4

File tree

4 files changed

+100
-6
lines changed

4 files changed

+100
-6
lines changed
 

‎P1543.cpp

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Baekjoon - 문서 검색
3+
* https://www.acmicpc.net/problem/1543
4+
* 2022년 01월 21일
5+
*/
6+
7+
#include <iostream>
8+
#include <string>
9+
10+
using namespace std;
11+
12+
int main() {
13+
ios_base::sync_with_stdio(false);
14+
cin.tie(NULL);
15+
cout.tie(NULL);
16+
17+
string origin, search;
18+
getline(cin, origin);
19+
getline(cin, search);
20+
21+
int res = 0;
22+
for (int i = 0; i < origin.size(); ++i) {
23+
bool flag = true;
24+
for (int j = 0; j < search.size(); ++j) {
25+
if (origin[i + j] != search[j]) {
26+
flag = false;
27+
break;
28+
}
29+
}
30+
if (flag) {
31+
res++;
32+
i += search.size() - 1;
33+
}
34+
}
35+
36+
cout << res;
37+
38+
return 0;
39+
}

‎P16673.py

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
C, K, P = map(int, input().split(' '))
2+
sum = 0
3+
for i in range(C):
4+
sum += K * (i+1) + P * pow(i+1, 2)
5+
print(sum)

‎P21965.cpp

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Baekjoon - 드높은 남산 위에 우뚝 선
3+
* https://www.acmicpc.net/problem/21965
4+
* 2022년 01월 21일
5+
*/
6+
7+
#include <iostream>
8+
#include <algorithm>
9+
10+
using namespace std;
11+
12+
int main() {
13+
ios_base::sync_with_stdio(false);
14+
cin.tie(NULL);
15+
cout.tie(NULL);
16+
17+
int N;
18+
int arr[100001];
19+
int tmp = 0;
20+
bool over = false;
21+
22+
cin >> N;
23+
24+
for (int i = 0; i < N; ++i) {
25+
cin >> arr[i];
26+
tmp = max(tmp, arr[i]);
27+
}
28+
29+
for (int i = 0; i < N - 1; ++i) {
30+
if (arr[i] == tmp) over = true;
31+
if (over) {
32+
if (arr[i + 1] >= arr[i]) {
33+
cout << "NO";
34+
return 0;
35+
}
36+
} else {
37+
if (arr[i + 1] <= arr[i]) {
38+
cout << "NO";
39+
return 0;
40+
}
41+
}
42+
}
43+
44+
cout << "YES";
45+
46+
return 0;
47+
}

‎README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@
44

55
| 날짜 | 티어 | 문제 | 소스 |
66
| ---------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------- |
7-
| 2022-01-17 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [4619 루트](https://www.acmicpc.net/problem/4619) | [P4619.cpp](./P4619.cpp) |
8-
| 2022-01-17 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [11008 복붙의 달인](https://www.acmicpc.net/problem/11008) | [P11008.py](./P11008.py) |
9-
| 2022-01-18 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [14568 2017 연세대학교 프로그래밍 경시대회](https://www.acmicpc.net/problem/14568) | [P14568.cpp](./P14568.cpp) |
10-
| 2022-01-18 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [2851 슈퍼 마리오](https://www.acmicpc.net/problem/2851) | [P2851.cpp](./P2851.cpp) |
11-
| 2022-01-19 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [22938 백발백준하는 명사수](https://www.acmicpc.net/problem/22938) | [P22938.py](./P22938.py) |
12-
| 2022-01-19 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [16495 열 순서](https://www.acmicpc.net/problem/16495) | [P16495.py](./P16495.py) |
7+
| 2022-01-21 | <img src="https://static.solved.ac/tier_small/7.svg" height="14px"/> | [1543 문서 검색](https://www.acmicpc.net/problem/1543) | [P1543.cpp](./P1543.cpp) |
8+
| 2022-01-21 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [21965 드높은 남산 위에 우뚝 선](https://www.acmicpc.net/problem/21965) | [P21965.cpp](./P21965.cpp) |
9+
| 2022-01-21 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [16673 고려대학교에는 공식 와인이 있다](https://www.acmicpc.net/problem/16673) | [P16673.py](./P10833.py) |
1310
| 2022-01-20 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [10833 사과](https://www.acmicpc.net/problem/10833) | [P10833.cpp](./P10833.cpp) |
11+
| 2022-01-19 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [16495 열 순서](https://www.acmicpc.net/problem/16495) | [P16495.py](./P16495.py) |
12+
| 2022-01-19 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [22938 백발백준하는 명사수](https://www.acmicpc.net/problem/22938) | [P22938.py](./P22938.py) |
13+
| 2022-01-18 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [2851 슈퍼 마리오](https://www.acmicpc.net/problem/2851) | [P2851.cpp](./P2851.cpp) |
14+
| 2022-01-18 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [14568 2017 연세대학교 프로그래밍 경시대회](https://www.acmicpc.net/problem/14568) | [P14568.cpp](./P14568.cpp) |
15+
| 2022-01-17 | <img src="https://static.solved.ac/tier_small/5.svg" height="14px"/> | [11008 복붙의 달인](https://www.acmicpc.net/problem/11008) | [P11008.py](./P11008.py) |
16+
| 2022-01-17 | <img src="https://static.solved.ac/tier_small/3.svg" height="14px"/> | [4619 루트](https://www.acmicpc.net/problem/4619) | [P4619.cpp](./P4619.cpp) |
1417

1518
## 2020
1619

0 commit comments

Comments
 (0)
Please sign in to comment.