목록Algorithm (187)
:: ADVANCE ::
BAEKJOON ONLINE JUDGE 2816번 디지털 티비 https://www.acmicpc.net/problem/2816 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#include #include #include using namespace std; int main(){ int n; int i = 0, j; string ch; string temp; vector channel; string KBS[2] = { "KBS1", "KBS2" }; scanf("%d", &n); while (n--) { cin >> ch; channel.push_back(ch); } for (..
BAEKJOON ONLINE JUDGE 10250번 ACM 호텔 https://www.acmicpc.net/problem/10250 1234567891011121314151617#include int main(){ int t; int w, h, n; scanf("%d", &t); while (t--) { scanf("%d %d %d", &h, &w, &n); printf("%d%02d\n", (n % h)? n % h : h, + ((n - 1) / h) + 1); } return 0;}cs
BAEKJOON ONLINE JUDGE 9095번 1, 2, 3 더하기 https://www.acmicpc.net/problem/9095 123456789101112131415161718192021222324252627#include int main(){ int d[11]; int n; int t; scanf("%d", &t); d[0] = 0; d[1] = 1; d[2] = 2; d[3] = 4; for (int i = 4; i
BAEKJOON ONLINE JUDGE 1149번 RGB거리 https://www.acmicpc.net/problem/1149 12345678910111213141516171819202122232425262728293031#include int min(int first, int second){ if (first
BAEKJOON ONLINE JUDGE 9935번 문자열 폭발 https://www.acmicpc.net/problem/9935 풀이 입력 받은 문자열을 하나씩 검사하면서 폭발 문자열과 일치할 경우 stack에 넣고 비교괄호 비교 문자와 비슷하게 풀면 된다. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081#include #include #include using namespace std; char input[1000010];char boom[40];int inputsize, boo..
BAEKJOON ONLINE JUDGE 1236번 성 지키기 https://www.acmicpc.net/problem/1236 1234567891011121314151617181920212223242526272829303132333435363738394041424344#include int max(int first, int second){ if (first > second) return first; return second;} int main(){ int n, m; int i, j; char map[51][51]; int wcnt = 0, hcnt = 0; scanf("%d %d", &n, &m); for (i = 0; i
BAEKJOON ONLINE JUDGE 1193번 분수 찾기 https://www.acmicpc.net/problem/1193 12345678910111213141516171819#include int main(){ int n; int x = 0; int d; scanf("%d", &n); while (x * (x + 1) / 2 > n; int t1, t2; for (int i = 1;; i++) { if (n - i
BAEKJOON ONLINE JUDGE 1181번 단어 정렬 12345678910111213141516171819202122232425262728293031323334#include #include #include #include using namespace std; bool cmp(const string &first, const string &second){ if (first.size() == second.size()) return first
BAEKJOON ONLINE JUDGE 1076번 저항 123456789101112131415161718192021222324252627282930313233343536#include #include #include char resister[10][7] = { "black", "brown", "red", "orange", "yellow", "green", "blue", "violet", "grey", "white" }; int numberofColor(char r[7]) { int index; for (index = 0; index
[Floyd] 플로이드 알고리즘 (graph 최단거리 알고리즘) 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include #define SIZE 101#define INF 1000 int graph[SIZE][SIZE];int floyd[SIZE][SIZE]; void init() { int i, j; for (i = 0; i