20250709 baekjoon
This commit is contained in:
parent
561d2c2c3c
commit
46fd6cf36d
10
code_study/Baekjoon/python/1929.py
Normal file
10
code_study/Baekjoon/python/1929.py
Normal file
@ -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]])))
|
||||||
15
code_study/Baekjoon/python/1966.py
Normal file
15
code_study/Baekjoon/python/1966.py
Normal file
@ -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)
|
||||||
8
code_study/Baekjoon/ts/18110.ts
Normal file
8
code_study/Baekjoon/ts/18110.ts
Normal file
@ -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);
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user