전체 글 (224) 썸네일형 리스트형 백준 17609 회문 https://www.acmicpc.net/problem/17609 #include using namespace std;string str;int check(int l, int r, bool palin) { while (l > t; for (int test = 0; test > str; cout 투 포인터 문제이다. 입력을 받고, 회문, 유사회문, 나머지를 판별하는 코드를 작성하는 문제이다. 풀이int check(int l, int r, bool palin) { while (l 우선 문자열의 맨 앞과 맨 뒤부터 가운데로 포인터를 옮기면서 문자를 하나씩 비교해 간다. palin에는 팰린드롬 여부가 들어간다. 문자를 비교하다 다른 문자가 온다면 두 가지로 나누어질 수 있.. 가게 정보 관련 RequestDto 가게 정보에 필요했던 Request 클래스는 다음과 같다. - StoreReq - StoreHygradeReq - UserCurReq 이 중 하나인 StoreReq를 살펴보면 다음과 같다.@Data@AllArgsConstructor@ToString@Builderpublic class StoreReq { private String storeName; //store 이름 private int zipCode; //우편번호 private String roadAddr; //도로명주소 private String lotAddr; //지번주소 private double wgs84Lat; //위도 private doub.. Hello, Refactoring! 대학교 졸업 프로젝트에서 아래의 프로젝트를 진행했다.https://github.com/TheperZ/a-Dream-Leaf GitHub - TheperZ/a-Dream-LeafContribute to TheperZ/a-Dream-Leaf development by creating an account on GitHub.github.com 졸업을 하고 공부를 더 하고, 프로젝트를 진행하다 보니 이 때의 코드는 "돌아는 가는" 코드라는 생각이 들었다. 대표적으로 드는 생각은 다음과 같았다. 1. 대용량 데이터 저장 위 데이터는 아동급식카드 가맹점 api의 head 부분이다. 프로젝트 발표 한 달 전 해당 api가 업데이트되면서 11,000개 가량이었던 카드가맹점 데이터가 15배 가량 증가하였다. 이에 .. 백준 2224 명제 증명 #include #include #include using namespace std;bool g[58][58];int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n; int cnt = 0; cin >> n; cin.ignore(); for (int i = 0; i = 26 && k = 26 && i = 26 && j " All Pairs Shortest Path 문제이다.그래프가 주어지고, 이 그래프에 대한 모든 가능한 쌍을 구하는 문제이다.floyd 알고리즘을 사용하여 문제를 해결할 수 있다. for (int k = 0; k = 26 && k = 26 && i .. 백준 2015 수들의 합 4 #include #include using namespace std;int prefix[200001];int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, k, num; long long ans = 0; map m; //m[i]=j: 누적합으로 i를 만들 수 있는 경우의 수=j cin >> n >> k; for (int i = 1; i > num; prefix[i] = prefix[i - 1] + num; if (prefix[i] == k) ans++; } for (int i = 1; i n을 20만까지 허용하므로 구간합을 모두.. 백준 14621 나만 안되는 연애 https://www.acmicpc.net/problem/14621 14621번: 나만 안되는 연애 입력의 첫째 줄에 학교의 수 N와 학교를 연결하는 도로의 개수 M이 주어진다. (2 ≤ N ≤ 1,000) (1 ≤ M ≤ 10,000) 둘째 줄에 각 학교가 남초 대학교라면 M, 여초 대학교라면 W이 주어진다. 다음 M개의 www.acmicpc.net #include #include #include using namespace std; int parent[1001]; int findParent(int k){ return parent[k] == k ? k : parent[k] = findParent(parent[k]); } void mg(int a, int b){ int pa = findParent(a);.. 백준 21275 폰 호석만 https://www.acmicpc.net/problem/21275 21275번: 폰 호석만 만약 문제의 조건에 맞는 X, A, B가 유일하게 존재한다면, X를 십진법으로 표현한 수와 A와 B를 공백으로 나누어 출력하라. 만약 만족하는 경우가 2가지 이상이라면 "Multiple"을, 없다면 "Impossible"을 www.acmicpc.net #include #include using namespace std; long long cal(int n, string s) { long long res = 0; int ptmp = 0; for (int i = s.size() - 1; i >= 0; i--) { int cur; if (isalpha(s[i])) { cur = s[i] - 'a' + 10; } els.. 백준 15787 백준 기차가 어둠을 헤치고 https://www.acmicpc.net/problem/15787 15787번: 기차가 어둠을 헤치고 은하수를 입력의 첫째 줄에 기차의 수 N(1 ≤ N ≤ 100000)과 명령의 수 M(1 ≤ M ≤ 100000)가 주어진다. 이후 두 번째 줄부터 M+1번째 줄까지 각 줄에 명령이 주어진다. www.acmicpc.net #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n, m; cin >> n >> m; vector arr(n + 1, 0); //i번째 기차의 탑승 현황 for (int cmd = 0; cmd < m; cmd++.. 이전 1 ··· 21 22 23 24 25 26 27 28 다음