์ „์ฒด ๊ธ€

Algorithm/SWEA

[SWEA - D3] 3456. ์ง์‚ฌ๊ฐํ˜• ๊ธธ์ด ์ฐพ๊ธฐ

๋‚˜์˜ ์ฝ”๋“œ T = int(input()) for t in range(1, T + 1): arr = list(map(int,input().split())) cnt = [0]*101 result = 0 for x in arr: cnt[x] += 1 for i in range(len(cnt)): if cnt[i] ==1 or cnt[i] ==3 : result = i print("#"+str(t) , result) ์ž…๋ ฅ๋ฐ›์€ ์ˆ˜๋ฅผ ์นด์šดํŒ…ํ–ˆ๋‹ค. ์ง„์งœ ๋ฉ์ฒญํ•˜๊ฒŒ ํ’€์—ˆ๋‹ค. ์ฝ”๋“œ ์ˆ˜์ • T = int(input()) for t in range(1, T + 1): arr = list(map(int,input().split())) arr.sort() result = 0 if arr[0] == arr[1]: result = a..

Algorithm/SWEA

[SWEA - D3] 1230. ์•”ํ˜ธ๋ฌธ3

๋‚˜์˜ ์ฝ”๋“œ for t in range(1, 11): N = int(input()) # ์ฒซ ๋ฒˆ์งธ ์ค„ : ์›๋ณธ ์•”ํ˜ธ๋ฌธ์˜ ๊ธธ์ด N arr = list(map(int,input().split())) # ๋‘ ๋ฒˆ์งธ ์ค„ : ์›๋ณธ ์•”ํ˜ธ๋ฌธ cmd = int(input()) # ์„ธ ๋ฒˆ์งธ ์ค„ : ๋ช…๋ น์–ด์˜ ๊ฐœ์ˆ˜ cmd_arr = list(input().split()) # ๋„ค ๋ฒˆ์งธ ์ค„ : ๋ช…๋ น์–ด for i in range(len(cmd_arr)): if cmd_arr[i] == 'A' : cnt = int(cmd_arr[i+1]) for j in range(cnt): tmp = int(cmd_arr[i+2+j]) arr.append(tmp) if cmd_arr[i] == 'I': idx = int(cmd_arr[i+1]) cn..

Algorithm/SWEA

[SWEA - D3] 1213. String

์ฃผ์–ด์ง€๋Š” ๋ฌธ์ž์—ด์—์„œ ํŠน์ •ํ•œ ๋ฌธ์ž์—ด์˜ ๊ฐœ์ˆ˜๋ฅผ ๋ฐ˜ํ™˜ํ•˜๊ธฐ๊ธฐ Starteatingwellwiththeseeighttipsforhealthyeating,whichcoverthebasicsofahealthydietandgoodnutrition. ์œ„ ๋ฌธ์žฅ์—์„œ ti ๋ฅผ ๊ฒ€์ƒ‰ํ•˜๋ฉด, ๋‹ต์€ 4์ด๋‹ค. ๋‚˜์˜ ์ฝ”๋“œ for _ in range(1, 11): t = int(input()) s1 = input() s2 = input() s1L = len(s1) s2L = len(s2) cnt = 0 for i in range(s2L-s1L+1): if s2[i:s1L+i] == s1: cnt += 1 print("#"+str(t) , cnt ) ํŒŒ์ด์ฌ์—๋Š” count ํ•จ์ˆ˜๊ฐ€ ์žˆ๋‹ค. ์ƒ๊ฐ ์•ˆ๋‚˜์„œ ๋ฌธ์ž์—ด ์Šฌ๋ผ์ด์‹ฑํ•ด์„œ ๋ฐ˜๋ณต๋ฌธ๋Œ๋ฆฌ๊ณ  ๋น„๊ตํ•ด์„œ ..

Algorithm/SWEA

[SWEA - D3] 1225. ์•”ํ˜ธ์ƒ์„ฑ๊ธฐ

๋‚˜์˜ ์ฝ”๋“œ from collections import deque for _ in range(1, 11): t = int(input()) arr = list(map(int,input().split())) deq = deque(arr) while 0 not in deq: for i in range(1,6): tmp = deq.popleft() if tmp-i

Develop/Web

์‹ค์‹œ๊ฐ„ ๊ณต์œ  ๋ฌธ์„œ ํŽธ์ง‘์„ ์œ„ํ•œ WebSocket ์ดํ•ด

WebSocket WebSocket์€ ์›น ๋ธŒ๋ผ์šฐ์ €์™€ ์›น ์„œ๋ฒ„ ๊ฐ„์˜ ์–‘๋ฐฉํ–ฅ ํ†ต์‹ ์„ ๊ฐ€๋Šฅํ•˜๊ฒŒ ํ•˜๋Š” ํ”„๋กœํ† ์ฝœ์ž…๋‹ˆ๋‹ค. ์ด์ „์—๋Š” ์›น ๋ธŒ๋ผ์šฐ์ €์™€ ์›น ์„œ๋ฒ„ ๊ฐ„์˜ ํ†ต์‹ ์€ ํด๋ผ์ด์–ธํŠธ์—์„œ ์„œ๋ฒ„๋กœ ์š”์ฒญ์„ ๋ณด๋‚ด๊ณ , ์„œ๋ฒ„์—์„œ ํด๋ผ์ด์–ธํŠธ๋กœ ์‘๋‹ต์„ ๋ณด๋‚ด๋Š” ๋‹จ๋ฐฉํ–ฅ ํ†ต์‹  ๋ฐฉ์‹์œผ๋กœ ์ด๋ฃจ์–ด์กŒ์Šต๋‹ˆ๋‹ค. ์ด๋Ÿฌํ•œ ๋ฐฉ์‹์€ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ ๋ฐ›๊ธฐ์—๋Š” ๋ถ€์ ํ•ฉํ–ˆ์Šต๋‹ˆ๋‹ค. WebSocket์€ ์ด๋Ÿฌํ•œ ๋ฌธ์ œ์ ์„ ํ•ด๊ฒฐํ•˜๊ธฐ ์œ„ํ•ด ๋งŒ๋“ค์–ด์ง„ ํ”„๋กœํ† ์ฝœ์ž…๋‹ˆ๋‹ค. WebSocket์€ HTTP์™€ ๋น„์Šทํ•œ ํ”„๋กœํ† ์ฝœ์„ ์‚ฌ์šฉํ•˜์ง€๋งŒ, ์ผ๋ฐ˜์ ์ธ HTTP์™€๋Š” ๋‹ฌ๋ฆฌ ๊ณ„์†์ ์ธ ์—ฐ๊ฒฐ์„ ์œ ์ง€ํ•˜๋ฉด์„œ ์–‘๋ฐฉํ–ฅ์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์›น ๋ธŒ๋ผ์šฐ์ €์—์„œ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ์ฃผ๊ณ ๋ฐ›์„ ์ˆ˜ ์žˆ๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์›น์†Œ์ผ“์€ ํด๋ผ์ด์–ธํŠธ๊ฐ€ ์ ‘์† ์š”์ฒญ์„ ํ•˜๊ณ  ์›น ์„œ๋ฒ„๊ฐ€ ์‘๋‹ตํ•œ ํ›„ ์—ฐ๊ฒฐ์„ ๋Š๋Š” ๊ฒƒ์ด..

Algorithm/SWEA

[SWEA - D3] 1216. ํšŒ๋ฌธ2

๊ฐ€์žฅ ๊ธด ํšŒ๋ฌธ์˜ ๊ธธ์ด๋ฅผ ๊ตฌํ•˜๋Š” ๋ฌธ์ œ ๋‚˜์˜ ์ฝ”๋“œ for _ in range(10): t = int(input()) arr = [] result = 0 for _ in range(100): arr.append(input()) for i in range(100): b = [x[i] for x in arr] for j in range(100): for length in range(1,101): if j+length > 100: break tmp1 = arr[i][j:j+length] tmp2 = b[j:j+length] if tmp1 == tmp1[::-1] and length > result: result = length if tmp2 == tmp2[::-1] and length > result: result..

Algorithm/SWEA

[SWEA - D3] 1215. ํšŒ๋ฌธ1

๋‚˜์˜ ์ฝ”๋“œ for t in range(1,11): length = int(input()) arr = [] cnt = 0 for _ in range(8): arr.append(input()) for j in range(8): b = [i[j] for i in arr] for i in range(0,9-length): if list(arr[j][i:length+i]) == list(reversed(arr[j][i:length+i])): cnt += 1 if list(b[i:length+i]) == list(reversed(b[i:length+i])): cnt += 1 print("#"+str(t) , cnt) 2์ฐจ์› ๋ฐฐ์—ด์—์„œ ํ–‰ ์ถœ๋ ฅํ•˜๊ธฐ a = [ [0, 1], [2, 3], [4, 5], [6, 7], [..

์ž๊ฒฉ์ฆ/๋ฆฌ๋ˆ…์Šค๋งˆ์Šคํ„ฐ 1๊ธ‰

[๋ฆฌ๋ˆ…์Šค๋งˆ์Šคํ„ฐ 1๊ธ‰ 2์ฐจ] ์ œ1401ํšŒ ๊ธฐ์ถœ๋ฌธ์ œ ์ž‘์—…์‹ ํ’€์ด (11~16๋ฒˆ)

11. ์•„ํŒŒ์น˜ ์›น ์„œ๋ฒ„ ๊ด€๋ฆฌ์ž์ธ ํ™๊ธธ๋™์€ ์•„๋ž˜์˜ ์กฐ๊ฑด์œผ๋กœ ์„ค์ •์„ ๋ณ€๊ฒฝํ•˜๋ ค๊ณ  ํ•œ๋‹ค. ๊ฐ ์กฐ๊ฑด ํ•ญ๋ชฉ์— ๋งž๋Š” httpd.conf ํŒŒ์ผ์˜ ์„ค์ •ํ•ญ๋ชฉ๊ณผ ์„ค์ •๊ฐ’์„ ์ ์œผ์‹œ์˜ค.(15์ ) โ– ์กฐ๊ฑด - ํฌํŠธ๋Š” 8080 ์œผ๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค. - ์›น ์„œ๋ฒ„์˜ ๋„๋ฉ”์ธ์„ www.ihd.or.kr๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค. - ์›น ๋ฌธ์„œ๊ฐ€ ์œ„์น˜ํ•˜๋Š” ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ “/var/www/html"๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค. - ๊ด€๋ฆฌ์ž ์ด๋ฉ”์ผ์ฃผ์†Œ๋Š” admin@ihd.or.kr๋กœ ๋ณ€๊ฒฝํ•œ๋‹ค. - ํด๋ผ์ด์–ธํŠธ์˜ ์š”์ฒญ์— index.jsp, index.html, index.htm ์ˆœ์œผ๋กœ ์‘๋‹ตํ•˜๋„๋ก ์„ค์ •ํ•œ๋‹ค. - ์•„ํŒŒ์น˜ ๋ฒ„์ „์€ 2.X ์ด๋‹ค. # vi /etc/httpd/conf/httpd.conf ( 1 ) 8080 ServerName ( 2 ) ( 3 ) "/var/www/html" Serve..

hello_u
๐Ÿ˜œ