백준 (497) 썸네일형 리스트형 [백준 14938번] 서강그라운드 (C++) 문제링크 : https://www.acmicpc.net/problem/14938 14938번: 서강그라운드 예은이는 요즘 가장 인기가 있는 게임 서강그라운드를 즐기고 있다. 서강그라운드는 여러 지역중 하나의 지역에 낙하산을 타고 낙하하여, 그 지역에 떨어져 있는 아이템들을 이용해 서바이벌을 www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; int N, M, R, result; vectorv[101]; int arr[101]; int dist[101]; priority_queue pq; void dijkstra(int s) { for(int i=0; i> .. [백준 2448번] 별 찍기 - 11 (C++) 문제링크 : https://www.acmicpc.net/problem/2448 2448번: 별 찍기 - 11 첫째 줄에 N이 주어진다. N은 항상 3×2k 수이다. (3, 6, 12, 24, 48, ...) (0 ≤ k ≤ 10, k는 정수) www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; char arr[3072][6143]; //세로 N, 가로 2N-1 void draw(int y, int x, int n) { if(n==3) //반복되는 기본 형태 그리기 { arr[y][x] = '*'; //첫째줄 arr[y+1][x-1] = '*'; //둘째줄 .. [백준 28279번] 덱 2 (C++) 문제링크 : https://www.acmicpc.net/problem/28279 28279번: 덱 2 첫째 줄에 명령의 수 N이 주어진다. (1 ≤ N ≤ 1,000,000) 둘째 줄부터 N개 줄에 명령이 하나씩 주어진다. 출력을 요구하는 명령은 하나 이상 주어진다. www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; dequedq; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int N; cin >> N; while(N--) { int num, x; cin >> num; switch(num) { cas.. [백준 1167번] 트리의 지름 (C++) 문제링크 : https://www.acmicpc.net/problem/1167 1167번: 트리의 지름 트리가 입력으로 주어진다. 먼저 첫 번째 줄에서는 트리의 정점의 개수 V가 주어지고 (2 ≤ V ≤ 100,000)둘째 줄부터 V개의 줄에 걸쳐 간선의 정보가 다음과 같이 주어진다. 정점 번호는 1부터 V까지 www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; vectorvec[100001]; bool visited[100001]; int result, target; void dfs(int idx, int dist) { visited[idx] = 1; i.. [백준 1967번] 트리의 지름 (C++) 문제링크 : https://www.acmicpc.net/problem/1967 1967번: 트리의 지름 파일의 첫 번째 줄은 노드의 개수 n(1 ≤ n ≤ 10,000)이다. 둘째 줄부터 n-1개의 줄에 각 간선에 대한 정보가 들어온다. 간선에 대한 정보는 세 개의 정수로 이루어져 있다. 첫 번째 정수는 간선이 연 www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; vectorvec[100001]; bool visited[100001]; int result, target; void dfs(int idx, int dist) { visited[idx] = 1;.. [백준 20529번] 가장 가까운 세 사람의 심리적 거리 (C++) 문제링크 : https://www.acmicpc.net/problem/20529 20529번: 가장 가까운 세 사람의 심리적 거리 각 테스트 케이스에 대한 답을 정수 형태로 한 줄에 하나씩 출력한다. www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; int N; vectorv; int cal(string s1, string s2, string s3) //3개 문자열 비교 { int result = 0; for(int i=0; i32) return 0; int result = MAX; for(int i=0; i>N; v.resize(N); for(int i.. [백준 14940번] 쉬운 최단거리 (C++) 문제링크 : https://www.acmicpc.net/problem/14940 14940번: 쉬운 최단거리 지도의 크기 n과 m이 주어진다. n은 세로의 크기, m은 가로의 크기다.(2 ≤ n ≤ 1000, 2 ≤ m ≤ 1000) 다음 n개의 줄에 m개의 숫자가 주어진다. 0은 갈 수 없는 땅이고 1은 갈 수 있는 땅, 2는 목표지점이 www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; int N, M; int arr[1001][1001]; int visited[1001][1001]; int dx[] = {1, -1, 0, 0}; int dy[] = {.. [백준 18110번] solved.ac (C++) 문제링크 : https://www.acmicpc.net/problem/18110 18110번: solved.ac 5명의 15%는 0.75명으로, 이를 반올림하면 1명이다. 따라서 solved.ac는 가장 높은 난이도 의견과 가장 낮은 난이도 의견을 하나씩 제외하고, {5, 5, 7}에 대한 평균으로 문제 난이도를 결정한다. www.acmicpc.net #include using namespace std; typedef long long ll; typedef pair pii; const int MAX = 987654321; int arr[300003]; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int N; cin >> N; for(int i=0; i.. 이전 1 ··· 32 33 34 35 36 37 38 ··· 63 다음