Skip to content

Commit

Permalink
ps
Browse files Browse the repository at this point in the history
  • Loading branch information
repryty committed Jul 22, 2024
1 parent 920b431 commit 857bb7b
Show file tree
Hide file tree
Showing 12 changed files with 543 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Baekjoon/10773.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
inp=[]
for _ in range(int(input())):
inpu=int(input())
if inpu==0: inp.pop()
else: inp.append(inpu)
print(sum(inp))
8 changes: 8 additions & 0 deletions Baekjoon/10989.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import sys
n=int(sys.stdin.readline())
inp = [0]*10001
for i in range(n):
inp[int(sys.stdin.readline())]+=1
for i in range(10001):
for ii in range(inp[i]):
sys.stdout.write(str(i)+"\n")
11 changes: 11 additions & 0 deletions Baekjoon/2775.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
for i in range(int(input())):
k = int(input())
n = int(input())

stairs=[[0 for _ in range(n)] for _ in range(k+1)]
stairs[0]=[ii for ii in range(1, n+1)]

for ii in range(1, k+1):
for iii in range(n):
stairs[ii][iii] = sum(stairs[ii-1][:iii+1])
print(stairs[k][n-1])
7 changes: 7 additions & 0 deletions Baekjoon/28702.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
inp=[None]*3
for i in range(3):
input_str=input()
try:
inp[i]=int(input_str)
except:
pass
5 changes: 5 additions & 0 deletions Baekjoon/31403.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A=input()
B=input()
C=input()
print(int(A)+int(B)-int(C))
print(int(A+B)-int(C))
8 changes: 8 additions & 0 deletions Baekjoon/7568.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
n = int(input())
weight, tall, end=[[0 for _ in range(n)] for i in range(3)]
for i in range(n):
weight[i], tall[i] = map(int, input().split())
for i in range(n):
for ii in range(n):
if weight[ii]>weight[i] and tall[ii]>tall[i]: end[i]+=1
print(" ".join(map(lambda x: str(x+1), end)))
5 changes: 5 additions & 0 deletions helloworld.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <stdio.h>

void main() {
printf("Hello, World!\n"
}
22 changes: 22 additions & 0 deletions hihi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from flask import Flask, jsonify
import requests

app = Flask(__name__)

@app.route('/gemini/api/v1/<endpoint>', methods=['GET'])
def gemini_api(endpoint):
# Replace 'YOUR_API_KEY' and 'YOUR_API_SECRET' with your actual Gemini API credentials
api_key = 'YOUR_API_KEY'
api_secret = 'YOUR_API_SECRET'

# Construct the Gemini API URL
url = f'https://api.gemini.com/v1/{endpoint}'

# Make a request to the Gemini API
response = requests.get(url, auth=(api_key, api_secret))

# Return the response as JSON
return jsonify(response.json())

if __name__ == '__main__':
app.run()
Empty file added pyautogui/0626.py
Empty file.
32 changes: 32 additions & 0 deletions randomimage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import random
from PIL import Image

def generate_random_noise():
# Initialize the seed with a random value
seed = random.random()
random.seed(seed)

# Generate random black and white noise
noise = []
for _ in range(250):
row = []
for _ in range(250):
# Get the previous pixel's result as the new seed
seed = random.random()
random.seed(seed)

pixel = random.choice([0, 255])
row.append(pixel)
noise.append(row)

return noise

# Example usage
random_noise = generate_random_noise()

# Create a PIL image from the noise data
image = Image.new("L", (255, 255))
image.putdata([pixel for row in random_noise for pixel in row])

# Display the image
image.show()
36 changes: 36 additions & 0 deletions words.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
text="""配(나눌 배) 信(믿을 신) 思(생각할 사) 遠(멀 원) 近(가까울 근) 強(강할 강) 卷(책 권)
雪(눈 설) 盛(왕성할 성) 螢(반딧불 형) 以(로서 이) 油(기름 유) 常(항상 상) 書 (글 서)
晝(낮 주) 寢(잘 침) 蛇(뱀 사) 旁(곁 방) 惶(두려울 황) 引(끌 인) 午(낮 오)
而(-하고 이) 捕(잡을 포) 擲(던질 척) 腹(배 복) 稍(조금 초) 優(나을 우) 壬(임)
沙(모래 사) 可(옳을 가) 命(목숨 명) 立(설 립) 名(이름 명)
"""

import re

def separate_english_korean(text):
# 결과를 저장할 두 개의 리스트
english_words = []
korean_words = []

# 줄바꿈을 기준으로 문자열을 분리하여 각 줄을 처리
lines = text.split('\n')
for line in lines:
Regular
# 정규 표현식을 사용하여 영어 부분과 한국어 부분을 구분
match = re.sub(r'\(([^)]+)\)', line, '')
# if match:
# english, korean = match.groups()
# english_words.append(english.strip())
# korean_words.append(korean.strip())


# return english_words, korean_words

print(re.sub(r'\(([^)]+)\)', '', text))
# english_words, korean_words = separate_english_korean(text)

# file = open('words.txt', 'w')
# content=""
# for i in range(len(english_words)):
# content+=english_words[i]+"\t"+korean_words[i]+'\n'
# file.write(content)
Loading

0 comments on commit 857bb7b

Please sign in to comment.