Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[송지민] 1주차 과제 제출 #2

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4295f85
[BJO] 일곱 난쟁이 / https://www.acmicpc.net/problem/2309
songing01 Sep 10, 2024
b259432
[BJO] 알파벳 개수 / https://www.acmicpc.net/problem/10808
songing01 Sep 10, 2024
933818f
[BJO] 트럭 주차 / https://www.acmicpc.net/problem/2979
songing01 Sep 10, 2024
670a652
[BJO] 팰린드롬인지 확인하기 / https://www.acmicpc.net/problem/10988
songing01 Sep 10, 2024
b33d2ba
[BJO] 농구 경기 / https://www.acmicpc.net/problem/1159
songing01 Sep 10, 2024
9e3e01b
[BJO] ROT 13 / https://www.acmicpc.net/problem/11655
songing01 Sep 10, 2024
d8679d4
[BJO] 한국이 그리울 땐 서버에 접속하지 / https://www.acmicpc.net/problem/9996
songing01 Sep 10, 2024
8ddc928
[BJO] 나는야 포켓몬 마스터 이다솜 / https://www.acmicpc.net/problem/1620
songing01 Sep 10, 2024
8715ede
[BJO] 패션왕 신해빈 / https://www.acmicpc.net/problem/9375
songing01 Sep 10, 2024
96194b2
[BJO] 팰린드롬 만들기 / https://www.acmicpc.net/problem/1213
songing01 Sep 10, 2024
e2520c9
[BJO] 주몽 / https://www.acmicpc.net/problem/1940
songing01 Sep 11, 2024
730cb4f
[BJO] 좋은 단어 / https://www.acmicpc.net/problem/3986
songing01 Sep 11, 2024
632ff97
[BJO] 1 / https://www.acmicpc.net/problem/4375
songing01 Sep 11, 2024
bd998f3
[BJO] 유기농 배추 / https://www.acmicpc.net/problem/1012
songing01 Sep 26, 2024
ba99c98
[BJO] 트리 / https://www.acmicpc.net/problem/1068
songing01 Sep 26, 2024
1025ee9
오타 수정
songing01 Sep 26, 2024
5b3dc4f
[BJO] 효율적인 해킹 / https://www.acmicpc.net/problem/1325
songing01 Sep 26, 2024
eb05fa9
[BJO] 영화감독 숌 / https://www.acmicpc.net/problem/1436
songing01 Sep 26, 2024
5aed405
[BJO] 미로 탐색 / https://www.acmicpc.net/problem/2178
songing01 Sep 27, 2024
5af3b1d
[BJO] 안전 영역 / https://www.acmicpc.net/problem/2468
songing01 Sep 27, 2024
bfa2e77
[BJO] 보물섬 / https://www.acmicpc.net/problem/2589
songing01 Sep 27, 2024
5dfe2df
[BJO] 영역 구하기 / https://www.acmicpc.net/problem/2583
songing01 Sep 28, 2024
f5cf716
주석 수정
songing01 Sep 28, 2024
3ff70cd
[BJO] / 치즈 / https://www.acmicpc.net/problem/2636
songing01 Sep 28, 2024
77dddfe
[BJO] 사과 담기 게임 / https://www.acmicpc.net/problem/2828
songing01 Sep 28, 2024
4b94605
[BJO] NBA 농구 / https://www.acmicpc.net/problem/2852
songing01 Sep 28, 2024
f95305c
[BJO] 수학숙제 / https://www.acmicpc.net/problem/2870
songing01 Sep 28, 2024
cb76588
[BJO] 빈도정렬 / https://www.acmicpc.net/problem/2910
songing01 Sep 28, 2024
1ae57fe
[BJO] 교수가 된 현우 / https://www.acmicpc.net/problem/3474
songing01 Sep 28, 2024
ab6cd96
[BJO] 비밀번호 발음하기 / https://www.acmicpc.net/problem/4659
songing01 Sep 28, 2024
b8f8cde
[BJO] 쿼드트리 / https://www.acmicpc.net/problem/1992
songing01 Sep 30, 2024
4b20089
[BJO] 컴백홈 / https://www.acmicpc.net/problem/1189
songing01 Sep 30, 2024
e9f5827
[BJO] 빙고 / https://www.acmicpc.net/problem/2578
songing01 Oct 2, 2024
645ade6
[BJO] 계단 오르기 / https://www.acmicpc.net/problem/2579
songing01 Oct 3, 2024
ef63139
[BJO] 피보나치 수 5 / https://www.acmicpc.net/problem/10870
songing01 Oct 3, 2024
c1f3852
[PGA] 정수 삼각형 / https://school.programmers.co.kr/learn/courses/30/less…
songing01 Oct 3, 2024
7af8f71
[PGA] 정수삼각형 / https://school.programmers.co.kr/learn/courses/30/lesso…
songing01 Oct 3, 2024
f6607a5
[PGA] N으로 표현 / https://school.programmers.co.kr/learn/courses/30/less…
songing01 Oct 4, 2024
eb0ebcc
[PGA] 의상 / https://school.programmers.co.kr/learn/courses/30/lessons/…
songing01 Oct 4, 2024
7a588e9
[PGA] 포켓몬 / https://school.programmers.co.kr/learn/courses/30/lessons…
songing01 Oct 4, 2024
67cceec
[PGA] 정수를 나선형으로 배치하기 /https://school.programmers.co.kr/learn/courses/…
songing01 Oct 4, 2024
d11cbdc
[PGA] 네트워크 / https://school.programmers.co.kr/learn/courses/30/lesson…
songing01 Oct 4, 2024
a97d40b
[PGA] 단어변환 / https://school.programmers.co.kr/learn/courses/30/lesson…
songing01 Oct 4, 2024
8e59c5d
[PGA] 가장 먼 노드 / https://school.programmers.co.kr/learn/courses/30/les…
songing01 Oct 4, 2024
29e3d5c
[BJO] 시계 / https://www.acmicpc.net/problem/17843
songing01 Oct 4, 2024
a5237bc
[BJO] 숫자 카드 2 / https://www.acmicpc.net/problem/10816
songing01 Oct 8, 2024
f5ea6a5
[BJO] 수 찾기 / https://www.acmicpc.net/problem/1920
songing01 Oct 8, 2024
1a8f6a3
[BJO] 나무 자르기 / https://www.acmicpc.net/problem/2805
songing01 Oct 8, 2024
0fc67d2
[BJO] 랜선 자르기 / https://www.acmicpc.net/problem/1654
songing01 Oct 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions extra/10816.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <bits/stdc++.h>

using namespace std;

int N, M;
map<int, int> m;
vector<int> v;

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);

cin >> N;
for (int i = 0; i < N; i++)
{
int num;
cin >> num;
if (m.find(num) != m.end())
{
m[num]++;
}
else
{
m.insert({num, 1});
v.push_back(num); // 중복없이 저장
}
}

sort(v.begin(), v.end());

cin >> M;
for (int i = 0; i < M; i++)
{
int num;
cin >> num;
if (binary_search(v.begin(), v.end(), num))
{
cout << m[num];
}
else
{
cout << 0;
}

if (i != M - 1)
{
cout << " ";
}
}
}
27 changes: 27 additions & 0 deletions extra/10870.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <bits/stdc++.h>

using namespace std;

int n;

int F[21] = {
0,
};

void go()
{
F[0] = 0;
F[1] = 1;
for (int i = 2; i <= n; i++)
{
F[i] = F[i - 1] + F[i - 2];
}
}

int main()
{
cin >> n;
go();

cout << F[n];
}
60 changes: 60 additions & 0 deletions extra/1654.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#include <bits/stdc++.h>

using namespace std;

int K, N;
vector<int> v;
int max_len = 1;
long long sum = 0;

void b_search()
{
long long low = 0;
long long high = sum / N;
// 다 합한 뒤 필요한 개수로 나눔 = 최대 길이
while (low <= high)
{
long long mid = (low + high) / 2;
if (mid == 0)
{
return;
}
// 각 랜선을 최대 길이로 나눈 몫의 합이 N과 같거나 클때 까지 연산
int cnt = 0;
for (int i = 0; i < K; i++)
{

cnt += v[i] / mid;
}

if (cnt >= N)
{
if (max_len < mid)
max_len = mid;
low = mid + 1;
}
else if (cnt < N)
{
high = mid - 1;
}
}
}

int main()
{

cin >> K >> N;
for (int i = 0; i < K; i++)
{
int a;
cin >> a;
v.push_back(a);
sum += a;
}

b_search();

cout << max_len;

return 0;
}
38 changes: 38 additions & 0 deletions extra/17843.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#include <bits/stdc++.h>

using namespace std;

int main()
{
int n;
cin >> n;
while (n--)
{
int h, m, s;
cin >> h >> m >> s;

// 시침: 1시간 30도 / 1분 0.5도 / 1초 0.008333
double a = 30 * h + m * (0.5) + s * 0.008333333;

// 분침: 1분 6도 / 1초 0.1도
double b = m * 6 + s * 0.1;

// 초침: 1초 6도
double c = 6 * s;

double temp1 = abs(a - b);
double temp2 = abs(a - c);
double temp3 = abs(b - c);

if (temp1 > 180)
temp1 = 360 - temp1;
if (temp2 > 180)
temp2 = 360 - temp2;
if (temp3 > 180)
temp3 = 360 - temp3;

double answer = min({temp1, temp2, temp3});

cout << fixed << setprecision(6) << answer << '\n';
}
}
55 changes: 55 additions & 0 deletions extra/181832.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include <bits/stdc++.h>

using namespace std;
int a[30][30] = {
0,
};

vector<vector<int>> solution(int n)
{
int curr = 1;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
if (!a[i][j])
{
a[i][j] = curr;
curr++;
}
}
for (int j = 0; j < n; j++)
{
if (!a[j][n - i - 1])
{
a[j][n - i - 1] = curr;
curr++;
}
}
for (int j = 0; j < n; j++)
{
if (!a[n - i - 1][n - 1 - j])
{
a[n - i - 1][n - 1 - j] = curr;
curr++;
}
}
for (int j = 0; j < n; j++)
{
if (!a[n - 1 - j][i])
{
a[n - 1 - j][i] = curr;
curr++;
}
}
}
vector<vector<int>> answer(n, vector<int>(n, 0));
for (int i = 0; i < n; i++)
{
for (int j = 0; j < n; j++)
{
answer[i][j] = a[i][j];
}
}
return answer;
}
27 changes: 27 additions & 0 deletions extra/1845.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#include <bits/stdc++.h>
using namespace std;

map<int, int> m;

int solution(vector<int> nums)
{
for (int num : nums)
{
if (m.find(num) != m.end())
{
m[num]++;
}
else
{
m.insert({num, 1});
}
}

// 가져갈 포켓몬 수
int total = nums.size() / 2;

int answer = m.size();
if (answer > total)
return total;
return answer;
}
52 changes: 52 additions & 0 deletions extra/1920.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#include <bits/stdc++.h>

using namespace std;

int N, M;
vector<int> a;

int b_search(int target, int low, int high)
{
while (low <= high)
{
int mid = (low + high) / 2;
if (a[mid] == target)
return 1;

if (a[mid] > target)
{
high = mid - 1;
}
else if (a[mid] < target)
{
low = mid + 1;
}
}

return 0;
}

int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N;
for (int i = 0; i < N; i++)
{
int num;
cin >> num;
a.push_back(num);
}

sort(a.begin(), a.end());

cin >> M;
for (int i = 0; i < M; i++)
{
int num;
cin >> num;
cout << b_search(num, 0, a.size() - 1) << '\n';
}
return 0;
}
Loading