๐งฎ PS
-
๋ฌธ์ ๋งํฌ:https://www.acmicpc.net/problem/1316 1316๋ฒ: ๊ทธ๋ฃน ๋จ์ด ์ฒด์ปค ๊ทธ๋ฃน ๋จ์ด๋ ๋จ์ด์ ์กด์ฌํ๋ ๋ชจ๋ ๋ฌธ์์ ๋ํด์, ๊ฐ ๋ฌธ์๊ฐ ์ฐ์ํด์ ๋ํ๋๋ ๊ฒฝ์ฐ๋ง์ ๋งํ๋ค. ์๋ฅผ ๋ค๋ฉด, ccazzzzbb๋ c, a, z, b๊ฐ ๋ชจ๋ ์ฐ์ํด์ ๋ํ๋๊ณ , kin๋ k, i, n์ด ์ฐ์ํด์ ๋ํ๋๊ธฐ ๋๋ฌธ์ ๊ทธ๋ฃน ๋จ์ด์ด์ง๋ง, aabbbccb๋ b๊ฐ ๋จ์ด์ ธ์ ๋ํ๋๊ธฐ ๋๋ฌธ์ ๊ทธ๋ฃน ๋จ์ด๊ฐ ์๋๋ค. ๋จ์ด N๊ฐ๋ฅผ ์ ๋ ฅ์ผ๋ก ๋ฐ์ ๊ทธ๋ฃน ๋จ์ด์ ๊ฐ์๋ฅผ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค. www.acmicpc.net 1. a๋ผ๋ ๋ณ์์ ๋ฆฌ์คํธ๋ก ๋จ์ด๋ฅผ ๋ฐ๋๋ค. 2. ๋จ์ด ํ๊ธ์์ฉ temp์ ์์์ ์ฅํ๋ค. 3. ๋จ์ด์ ๊ธธ์ด๋งํผ for๋ฌธ์ ๋๋ ค, ์๋ก์ด ๋ฆฌ์คํธ์ธ b์ ํ๊ธ์์ฉ ๋ฃ๋๋ค. 4. ์ด๋ ์์์ ์ฅ..
๋ฐฑ์ค (boj) 1316 ํ์ด์ฌ - ๊ทธ๋ฃน ๋จ์ด ์ฒด์ปค๋ฌธ์ ๋งํฌ:https://www.acmicpc.net/problem/1316 1316๋ฒ: ๊ทธ๋ฃน ๋จ์ด ์ฒด์ปค ๊ทธ๋ฃน ๋จ์ด๋ ๋จ์ด์ ์กด์ฌํ๋ ๋ชจ๋ ๋ฌธ์์ ๋ํด์, ๊ฐ ๋ฌธ์๊ฐ ์ฐ์ํด์ ๋ํ๋๋ ๊ฒฝ์ฐ๋ง์ ๋งํ๋ค. ์๋ฅผ ๋ค๋ฉด, ccazzzzbb๋ c, a, z, b๊ฐ ๋ชจ๋ ์ฐ์ํด์ ๋ํ๋๊ณ , kin๋ k, i, n์ด ์ฐ์ํด์ ๋ํ๋๊ธฐ ๋๋ฌธ์ ๊ทธ๋ฃน ๋จ์ด์ด์ง๋ง, aabbbccb๋ b๊ฐ ๋จ์ด์ ธ์ ๋ํ๋๊ธฐ ๋๋ฌธ์ ๊ทธ๋ฃน ๋จ์ด๊ฐ ์๋๋ค. ๋จ์ด N๊ฐ๋ฅผ ์ ๋ ฅ์ผ๋ก ๋ฐ์ ๊ทธ๋ฃน ๋จ์ด์ ๊ฐ์๋ฅผ ์ถ๋ ฅํ๋ ํ๋ก๊ทธ๋จ์ ์์ฑํ์์ค. www.acmicpc.net 1. a๋ผ๋ ๋ณ์์ ๋ฆฌ์คํธ๋ก ๋จ์ด๋ฅผ ๋ฐ๋๋ค. 2. ๋จ์ด ํ๊ธ์์ฉ temp์ ์์์ ์ฅํ๋ค. 3. ๋จ์ด์ ๊ธธ์ด๋งํผ for๋ฌธ์ ๋๋ ค, ์๋ก์ด ๋ฆฌ์คํธ์ธ b์ ํ๊ธ์์ฉ ๋ฃ๋๋ค. 4. ์ด๋ ์์์ ์ฅ..
2020.02.04 -
๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1078๋ฒ a = int(input()) n = 2;sum = 0 while(a+1 > n) : sum += n n += 2 print(sum) *1079๋ฒ a = list(map(str,input().split())) for i in a : print(i) if i == 'q': exit() *1080๋ฒ a = int(input()) sum = 0; n = 1 while(True): sum +=n if sum == a or sum > a : print(n) exit() n +=1 *1081๋ฒ n,m = map(int,input().split()) for i in ra..
์ฝ๋์ (Code up) 1078 ~ 1092 (์ข ํฉ) ํ์ด์ฌ ํ์ด๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1078๋ฒ a = int(input()) n = 2;sum = 0 while(a+1 > n) : sum += n n += 2 print(sum) *1079๋ฒ a = list(map(str,input().split())) for i in a : print(i) if i == 'q': exit() *1080๋ฒ a = int(input()) sum = 0; n = 1 while(True): sum +=n if sum == a or sum > a : print(n) exit() n +=1 *1081๋ฒ n,m = map(int,input().split()) for i in ra..
2020.02.03 -
๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1071 a = list(map(int,input().split())) for i in a : if i == 0: exit() else: print(i) *1072 n = int(input()) a = list(map(int,input().split())) for i in a : print(i) *1073 a = list(map(int,input().split())) for i in a : if i == 0: exit() else: print(i) *1074 n = int(input()) for i in range(n): print(n-i) *1075 n = int(i..
์ฝ๋์ (Code up) 1071 ~ 1077 (๋ฐ๋ณต์คํ๊ตฌ์กฐ) ํ์ด์ฌ ํ์ด๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1071 a = list(map(int,input().split())) for i in a : if i == 0: exit() else: print(i) *1072 n = int(input()) a = list(map(int,input().split())) for i in a : print(i) *1073 a = list(map(int,input().split())) for i in a : if i == 0: exit() else: print(i) *1074 n = int(input()) for i in range(n): print(n-i) *1075 n = int(i..
2020.02.02 -
๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1010๋ฒ x = int(input()) print(x) *1011๋ฒ x = str(input()) print(x) *1012๋ฒ x = float(input()) print("%f"%x) *1013๋ฒ a, b = map(int,input().split()) print(a,b) *1014๋ฒ a, b = map(str,input().split()) print(b,a) *1015๋ฒ a = float(input()) print("%0.2f"%a) ์์์ ๋์งธ์๋ฆฌ์์ ๋ฐ์ฌ๋ฆผํ๋ ค๋ฉด %0.2f ๋๋ %.2f ๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค. *1016๋ฒ a = input() print(a,a,a..
์ฝ๋์ (Code up) 1010 ~ 1027 (์ ์ถ๋ ฅ) ํ์ด์ฌ ํ์ด๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1010๋ฒ x = int(input()) print(x) *1011๋ฒ x = str(input()) print(x) *1012๋ฒ x = float(input()) print("%f"%x) *1013๋ฒ a, b = map(int,input().split()) print(a,b) *1014๋ฒ a, b = map(str,input().split()) print(b,a) *1015๋ฒ a = float(input()) print("%0.2f"%a) ์์์ ๋์งธ์๋ฆฌ์์ ๋ฐ์ฌ๋ฆผํ๋ ค๋ฉด %0.2f ๋๋ %.2f ๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค. *1016๋ฒ a = input() print(a,a,a..
2020.02.01 -
๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1093๋ฒ n = int(input()) array = list(map(int,input().split())) all = [0]*23 for i in array : all[i-1] += 1 for j in all : print(j,end=" ") *1094๋ฒ n = int(input()) array = list(map(int,input().split())) result = reversed(array) for i in result : print(i,end=' ') *1095๋ฒ n = int(input()) array = list(map(int,input().split()..
์ฝ๋์ (Code up)1093 ~ 1099 (์ข ํฉ) ํ์ด์ฌ ํ์ด๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1093๋ฒ n = int(input()) array = list(map(int,input().split())) all = [0]*23 for i in array : all[i-1] += 1 for j in all : print(j,end=" ") *1094๋ฒ n = int(input()) array = list(map(int,input().split())) result = reversed(array) for i in result : print(i,end=' ') *1095๋ฒ n = int(input()) array = list(map(int,input().split()..
2020.02.01 -
๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1065๋ฒ a, b, c= map(int,input().split()) if a % 2 ==0 : print(a) if b % 2 ==0 : print(b) if c % 2 ==0 : print(c) *1066๋ฒ a, b, c= map(int,input().split()) print("even" if a % 2 ==0 else "odd") print("even" if b % 2 ==0 else "odd") print("even" if c % 2 ==0 else "odd") *1067๋ฒ a = int(input()) print("minus" if a < 0 else "p..
์ฝ๋์ (Code up) 1065 ~ 1070 (์ ํ์คํ๊ตฌ์กฐ) ํ์ด์ฌ ํ์ด๋ฌธ์ ๋งํฌ : https://codeup.kr/problemsetsol.php?psid=23 ๋ฌธ์ ์ง / ๊ธฐ์ด 100์ codeup.kr *1065๋ฒ a, b, c= map(int,input().split()) if a % 2 ==0 : print(a) if b % 2 ==0 : print(b) if c % 2 ==0 : print(c) *1066๋ฒ a, b, c= map(int,input().split()) print("even" if a % 2 ==0 else "odd") print("even" if b % 2 ==0 else "odd") print("even" if c % 2 ==0 else "odd") *1067๋ฒ a = int(input()) print("minus" if a < 0 else "p..
2020.02.01