20250701 baekjoon

This commit is contained in:
songyc macbook 2025-07-01 20:40:35 +09:00
parent 797df26433
commit 8e946f332d
6 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,15 @@
#include <stdio.h>
int main() {
int N;
scanf("%d",&N);
int res = 0;
for(int i=5; i<=N; i=i*5){
res += N/i;
}
printf("%d\n",res);
return 0;
}

View File

@ -0,0 +1,7 @@
member = []
for _ in range(int(input())):
_age, _name = input().split()
member.append((int(_age), _name))
for m in sorted(member,key = lambda x:x[0]):
print(m[0], m[1])

View File

@ -0,0 +1,8 @@
arr = set()
for _ in range(int(input())) :
arr.add(input())
arr = sorted(list(arr))
arr = sorted(arr, key=len)
for r in arr:
print(r)

View File

@ -0,0 +1,12 @@
arr = []
for _ in range(int(input())) :
a, b = map(int,input().split())
arr.append((a,b))
for tup in arr :
k=0
for temp in arr:
if temp[0]>tup[0] and temp[1]>tup[1] :
k += 1
print(k+1,end=" ")
print()

View File

@ -0,0 +1,13 @@
export {};
const input: string[] = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');
let arr:[number, number][] = [];
for(let i=1; i<=Number(input[0]); i++){
let [x, y] = input[i].split(' ').map(Number);
arr.push([x,y]);
}
arr.sort((a,b)=>{
if(a[0]!==b[0]) return a[0] - b[0];
else return a[1]-b[1];
})
arr.forEach(v => console.log(v[0],v[1]));

View File

@ -0,0 +1,4 @@
export {};
const input: string[] = require("fs").readFileSync(0,"utf8").toString().trim().split('\n');
let arr:number[] = input.slice(1).map(Number).sort((a,b)=>a-b);
console.log(arr.join('\n'));