diff --git a/code_study/Baekjoon/python/1929.py b/code_study/Baekjoon/python/1929.py new file mode 100644 index 0000000..209e7aa --- /dev/null +++ b/code_study/Baekjoon/python/1929.py @@ -0,0 +1,10 @@ +m,n = map(int, input().split()) +isPrime = [True if i>1 else False for i in range(n+1)] +for i in range(2,int(n**0.5)+1): + if isPrime[i]: + num = i*i + while num<=n: + isPrime[num] = False + num += i + +print('\n'.join(map(str, [i for i in range(m,n+1) if isPrime[i]]))) \ No newline at end of file diff --git a/code_study/Baekjoon/python/1966.py b/code_study/Baekjoon/python/1966.py new file mode 100644 index 0000000..b78027f --- /dev/null +++ b/code_study/Baekjoon/python/1966.py @@ -0,0 +1,15 @@ +for _ in range(int(input())) : + n, m = map(int, input().split()) + priority = list(map(int,input().split())) + + result = 1 + while priority: + if priority[0] < max(priority): + priority.append(priority.pop(0)) + else : + if not m : + break + priority.pop(0) + result += 1 + m = m-1 if m>0 else len(priority)-1 + print(result) \ No newline at end of file diff --git a/code_study/Baekjoon/ts/18110.ts b/code_study/Baekjoon/ts/18110.ts new file mode 100644 index 0000000..c1ef1fa --- /dev/null +++ b/code_study/Baekjoon/ts/18110.ts @@ -0,0 +1,8 @@ +export {} +const input: number[] = require("fs").readFileSync(0,"utf8").toString().trim().split('\n').map(Number); +if(input[0]===0) console.log(0); +else { + const exceptValue: number = Math.round(input[0]*0.15); + const level = Math.round(input.slice(1).sort((a,b)=>a-b).slice(exceptValue,input[0]-exceptValue).reduce((acc,val)=>acc+val,0)/(input[0]-2*exceptValue)); + console.log(level); +} \ No newline at end of file