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')
def tinhcanh(x1,y1,x2,y2):
canh=(x1-x2)**2+(y1-y2)**2
canh=math.sqrt(canh)
return canh
def dientich(a,b,c):
if a+b>c and a+c>b and c+b>a and a>0 and b>0 and c>0:
p=(a+b+c)/2
k=math.sqrt(p*(p-a)*(p-b)*(p-c))
return k
else:
return 0
n=int(input())
a=[]
for i in range(n):
b=list(map(int,input().split()))
a.append(b)
tong=0
c=[]
for i in range(len(a)-1):
for j in range(len(a[0])-1):
c.append(tinhcanh(a[i][j],a[i][j+1],a[i+1][j],a[i+1][j+1]))
c.append(tinhcanh(a[0][0],a[0][1],a[len(a)-1][len(a[0])-2],a[len(a)-1][len(a[0])-1]))
print('%0.0f'%sum(c))
tongdt=0
for i in range(1,len(c)-1):
tongdt+=dientich(c[0],c[i],c[i+1])
print('%0.0f'%tongdt) 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
⚙️ Máy tính bị đơ, khởi động chậm – vấn đề ai cũng gặp Bạn…
Đề 2 thi học sinh giỏi lớp 9 môn Tin học – Tỉnh Bình Định…
1. Giới Thiệu: “Nỗi Đau Thầm Lặng” Mang Tên – Chi Phí In Ấn Văn…
⚙️ Máy tính bật không lên – nỗi lo không của riêng ai Bạn đang…
Mở bài – Nỗi ám ảnh của dân đồ họa: máy lag, render chậm, deadline…
Bạn đã bao giờ chờ cả 10 phút mà laptop vẫn chưa khởi động xong…
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.