100 đề và đáp an thi HSG Tin Python
Thầy Tấn Dân sẽ giải cho các em 10 đề thi và đáp án thi HSG ( học sinh giỏi ) tin học python lớp 10 THCS ( Trung học cơ sở ) cấp Huyện ở Tiền Giang cho các bạn tham khảo thêm nhé!
DANH SÁCH TÓM TẮT:
Tự học Python từ cơ bản đến nâng cao giải đề Miễn Phí tài liệu pdf tải về miễn phí nhé!
KỲ THI HỌC SINH GIỎI CẤP THÀNH PHỐ MỸ THO
TRUNG HỌC CƠ SỞ NĂM 2022 – 2023
Môn: TIN HỌC
Thời gian: 150 phút (không kể thời gian giao đề)
Ngày thi: 14/02/2023
(Để thi có 03 trang, gồm 05 bài)
TỔNG QUAN CÁC BÀI THI GỒM:
| Tên bài | File chưong trình | File dữ liệu vào | File kết quả |
| Bài 1. | APERTURE.* | APERTURE.INP | APERTURE. OUT |
| Bài 2. | STEP.* | STEP.INP | STEP. OUT |
| Bài 3. | SUMSQDIGIT.* | SUMSQDIGIT.INP | SUMSQDIGIT.OUT |
| Bài 4. | SYNSTRING.* | SYNSTRING.INP | SYNSTRING.OUT |
| Bài 5. | PERIJPOLYGON.* | PERIPOLYGON.INP | PERIPOLY GON.OUT |
| Dấu * được thay thế bởi PAS, CPP, PY của ngôn ngữ lập trình được sử dụng tương ứng là Free Pascal, c++, Python hoặc phần mở rộng tương ứng với NNLT khác. |
| APERTURE.INP | APERTURE.OUT |
| 2456878989 | 10 |
| 11111222223333355555577777777777777 | 0 |
| STEP.INP | STEP.OUT |
| 4 123 13468 1244 13579 | 3 |
| 12 12 24 35 22 100 5689 34567 25678 43567 1234679 2 1456 | 6 |
| SUM_SQDIGIT.INP | SUM_SQDIGIT.OUT |
| 998 | 28 |
| 8967999999997432222 | 140 |
| SYNSTRING.INP | SYNSTRING.OUT |
| 02203 | 22 |
| jhfgkjgflkhgeeehhkkkkkaaaaakkkk | kkkkk |
| PERI_POLYGON.INP | PERI_POLYGON.OUT |
| 3 | 184 |
| 30 30 | 1462 |
| 75 15 | |
| 90 75 |
| 4 | 87 |
| 9 16 | 348 |
| 24 11 | |
| 42 14 | |
| 42 31 |
HẾT
Thí sinh được sử dụng các loại máy tính theo quy định của Bộ Giáo dục và Đào tạo cho phép, thí sinh không được sứ dụng tài liệu. Cán bộ coi thi không được giải thích gì thêm.
import sys
sys.stdin=open('APERTURE.INP','r')
sys.stdout=open('APERTURE.OUT','w')
s=list(input())
tong=0
for i in range(len(s)):
if s[i]=='0' or s[i]=='4' or s[i]=='6'or s[i]=='9':
tong+=1
elif s[i]=='8':
tong+=2
print(tong)
import sys
sys.stdin=open('STEP.INP','r')
sys.stdout=open('STEP.OUT','w')
def ktbatthang(n):
s=str(n)
if len(s)>1:
dem=0
for i in range(len(s)-1):
if int(s[i+1])-int(s[i])==1 or int(s[i+1])-int(s[i])==2:
dem+=1
if dem==len(s)-1:
return True
else:
return False
else:
return False
n=int(input())
a=list(map(int,input().split()))
dem=0
for i in range(len(a)):
if ktbatthang(a[i]):
dem+=1
print(dem)
import sys
sys.stdin=open('SUMSQDIGIT.INP','r')
sys.stdout=open('SUMSQDIGIT.OUT','w')
def binhphuong(s):
n=int(s)
n=n**2
n=str(n)
tong=0
for i in range(len(n)):
tong+=int(n[i])
return tong
s=input()
s=list(s)
tong=0
for i in range(len(s)):
tong+=binhphuong(s[i])
print(tong)
import sys
sys.stdin=open('DELONE.INP','r')
sys.stdout=open('DELONE.OUT','w')
def ktsub(s):
dem=0
t=len(s)
s=list(s)
for i in range(len(s)-1):
if s[i]==s[i+1]:
dem+=1
return (t-1)==dem
s=list(input())
b=[]
for i in range(len(s)):
for j in range(i+1,len(s)):
sub=s[i:j]
if ktsub(sub) and len(sub)>1:
b.append(sub)
M=max(b)
print(*M,sep="")
import sys,math
sys.stdin=open('PERIJPOLYGON.INP','r')
sys.stdout=open('PERIJPOLYGON.OUT','w')
n=int(input())
x=[]
y=[]
for _ in range(n):
s=input().split()
x.append(s[0])
y.append(s[1])
cv=0
for i in range(len(x)):
cv+=math.sqrt((int(x[i-len(x)+1])-int(x[i]))**2+(int(y[i-len(x)+1])-int(y[i]))**2)
print('%0.0f'%cv)
i=0
tong_p=0
while i<len(x):
if len(x)-1==i:
tong_p+=(int(x[i])*int(y[0]))
i+=1
else:
tong_p+=(int(x[i])*int(y[i-len(x)+1]))
i+=1
tong_Q=0
j=0
while j<len(y):
if len(y)-1==j:
tong_Q+=(int(y[j])*int(x[0]))
j+=1
else:
tong_Q+=(int(y[j])*int(x[j-len(y)+1]))
j+=1
dt=(abs(tong_p-tong_Q))/2
print('%0.0f'%dt) Chú ý: bài tập chỉ mang tính chất tham khảo nhen các bạn! bạn nào có cách giải hay hơn hoặc có thắc mắc xin hãy để lại bình luận phía dưới mình sẽ giải đáp ạ ! xin chân thành cảm ơn !
Khóa học Python online từ cơ bản đến nâng cao
100 Bài Lập Trình Python Có Lời Giải Cơ Bản Đến Nâng Cao PDF –…
100 Đề Tổng Hợp Thi Tin Học Ứng Dụng Cơ Bản – Đại học Khoa…
⭐ Giới thiệu: Laptop lỗi ngay lúc đang gấp? Đừng hoảng! Laptop đang dùng ngon…
✅ Giới thiệu Bạn đang dùng PC thì đột nhiên đơ, chậm, xoay vòng mãi…
Mở bài – Khó khăn khi laptop gặp sự cố nhưng không thể mang ra…
Mở bài – Ổ cứng SSD quan trọng thế nào với dân đồ họa Đối…
This website uses cookies.
View Comments
I have been exploring for a little bit for any high-quality articles or weblog posts on this kind of area . Exploring in Yahoo I at last stumbled upon this website. Reading this information So i am happy to show that I've an incredibly just right uncanny feeling I discovered just what I needed. I so much unquestionably will make sure to don’t forget this site and provides it a glance regularly.
I really like your writing style, fantastic info, appreciate it for putting up :D. "Nothing sets a person so much out of the devil's reach as humility." by Johathan Edwards.