목록Algorithm/구현 | ETC (50)
:: ADVANCE ::
BAEKJOON ONLINE JUDGE 1085 직사각형에서 탈출 https://www.acmicpc.net/problem/1085 123456789101112131415161718192021222324#include int min(int first, int second){ if (first
BAEKJOON ONLINE JUDGE 1049 기타줄 https://www.acmicpc.net/problem/1049 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#include #define Min(x, y) (((x)
BAEKJOON ONLINE JUDGE 13199 치킨 먹고 싶다 https://www.acmicpc.net/problem/13199 문제 열자마자 일단 당황...ㅋㅋㅋㅋ 12345678910111213141516171819202122232425262728293031#include int chicken, money, f, c; int main(){ int nCount; int doyung, sangun, docnt, sangcnt; scanf("%d", &nCount); while (nCount--) { scanf("%d %d %d %d", &chicken, &money, &f, &c); doyung = docnt = sangun = money / chicken; docnt = sangcnt = docn..
BAEKJOON ONLINE JUDGE 1225 이상한 곱셈 https://www.acmicpc.net/problem/1225 123456789101112131415161718192021#include char first[10001], second[10001]; int main(){ int i, j; long long int ans = 0; scanf("%s %s", first, second); for (i = 0; first[i] != '\0'; i++) { for (j = 0; second[j] != '\0'; j++) { ans += (first[i] - '0') * (second[j] - '0'); } } printf("%lld\n", ans); return 0;}Colored by Color S..
BAEKJOON ONLINE JUDGE 11565 바이너리 게임 https://www.acmicpc.net/problem/11565 1234567891011121314151617181920212223242526272829#include char str[1001]; int main(){ int i; int a = 0, b = 0; scanf("%s", str); for (i = 0; str[i] != '\0'; i++) { if(str[i] == '1') a++; } str[0] = '\0'; scanf("%s", str); for (i = 0; str[i] != '\0'; i++) { if (str[i] == '1') b++; } if (a % 2) a++; if (a >= b) printf("VICTO..
BAEKJOON ONLINE JUDGE 1213 팰린드롬 만들기 https://www.acmicpc.net/problem/1213 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950#include char input[55];int alpha[26];int right[55]; int main(){ int cnt = 0; int i, j; int center = -1; scanf("%s", input); for (i = 0; input[i] != '\0'; i++) { alpha[input[i] - 'A']++; } for (i = 0; i = 2) { printf("I'm Sorry Hansoo..
BAEKJOON ONLINE JUDGE 1446 지름길 https://www.acmicpc.net/problem/1446 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include #include #include using namespace std; #define Min(x, y) (((x)
BAEKJOON ONLINE JUDGE 1037 약수 https://www.acmicpc.net/problem/1037 1234567891011121314151617181920212223#include int n; int main(){ int i; int num; int min = 1e9, max = 0; scanf("%d", &n); for (i = 0; i
BAEKJOON ONLINE JUDGE 1475 방 번호 https://www.acmicpc.net/problem/1475 1234567891011121314151617181920212223242526272829#include int num[10]; int main(){ int number; int cnt; int i; scanf("%d", &number); while (number) { num[number % 10]++; number /= 10; } cnt = (num[9] + num[6] + 1) / 2; for (i = 0; i cnt) cnt = num[i]; } } printf("%d\n", cnt); return 0;}Colored by Color Scriptercs
BAEKJOON ONLINE JUDGE 7469 K번째 숫자 https://www.acmicpc.net/problem/7469 O(n*m) 이하로 풀어야 하는 문제처음에 quick select로 문제를 풀려 하였으나O(m*n + a)라서 시간초과 O(n*m) -> 입력을 index와 값을 같이 저장한 후 값을 기준으로 정렬 정렬한 값을 다 돌면서 index가 주어진 범위안에 있는 수 중 k 번째를 찾아서 출력 12345678910111213141516171819202122232425262728293031323334353637383940414243444546#include #include using namespace std; struct Number { int num, idx;}; int n;Number ..