huangtank

@huangtank

Member of
Not member of any team yet

Joined on Aug 18, 2023

這裡存放著技藝競賽歷屆題目我寫過程的程式碼,歡迎多多討論,亦或者幫我找出更好的解法QQ

  • 你好,陌生人,我是 ice. ,本名是黃昱懷,目前是高三年級,喜歡寫程式。 營隊 2023年 2023/02/03-02/05 駭客程式設計營 2023/02/07 北商 AR 技術應用與體驗研習 2024年
     Like  Bookmark
  • 題目出處:點我 ==建議看完題目再來看這裡。== pA. 電腦教室 尋找最大值即可。 n=int(input()) a=[int(i) for i in input().split()] print(max(a)) pB. 幾何圖形多面體
     Like  Bookmark
  • 題目出處:點擊 pA. 二數有權重的相加–(單列) a,b=map(int,input().split()) print(4*a+6*b) pB. 剪刀石頭布單行版 n1,n2=input().split() if n2==n1: print(0) elif n1=='Y':
     Like  Bookmark
  • pA. 計算字數 for _ in range(int(input())): print(len(input().split())) pB. 摩斯電碼 d = {"-----":"0", ".----":"1", "..---":"2", "...--":"3", "....-":"4", ".....":"5", "-....":"6", "--...":"7", "---..":"8", "----.":"9"} for _ in range(int(input())): a = input().split() ans = "" for i in a: ans += d[i]
     Like  Bookmark
  • pA. 判斷字串是否有「駝峰」 s = [int(i) for i in list(input())] for i in range(1, len(s)-1): if max(s[0:i]) < s[i] and max(s[i+1::]) < s[i]: print(1) break else: print(0) pB. 判斷「趨勢」 s = list(input())
     Like  Bookmark
  • pA. 二數有權重相加–(單列) a, b = map(int, input().split()) print(4*a+6*b) pB. 陣列中重複的部分拿掉 print(len(set([int(i) for i in input().split()]))) pC. 回文 a = input() print(True if a == a[::-1] else False) pD. 寶石 s, j = input().split()
     Like  Bookmark
  • 這些商科技藝競賽歷屆試題的答案為筆者(黃昱懷)撰寫,如有疑問,可以用註解來做發問! 答案可以至此處 OJ 來做驗證,有一些題目我做不出來,如果有做出來的也能透過註解幫助我完成!
     Like  Bookmark
  • 題目出處:點擊 pA1. 民國年 print(int(input())-1911) pA2. 閏年(0結束) n = int(input()) while n: print("a leap year" if n%4 == 0 and n%100 != 0 or n%400 == 0 else "a normal year") n = int(input()) pB. 壞的遙控器
     Like  Bookmark
  • 前言 113 113_01 113_02 112 112正式試題 112模擬試題 112-1129
     Like  Bookmark
  • pA. 判斷二個數字是否為孿生質數 for _ in range(int(input())): a, b = map(int, input().split(",")) if abs(a-b) != 2: print("N") continue for i in range(2, int(a**0.5)+1): if not(a%i): print("N") break
     Like  Bookmark
  • pA. 非嚴格遞增子集合 while True: try: ans = 0 a = [int(i) for i in list(input())] temp = 0 for i in range(len(a)): for j in range(i+1, len(a)): if a[j-1] > a[j]: j -= 1
     Like  Bookmark
  • pA. 三數有權重的相加 a, b, c, d = map(int, input().split()) print(56*a+24*b+14*c+6*d) pB1. 閏年(1 行版) y = int(input()) if y%4 == 0 and y%100 != 0 or y%400 == 0: print("a leap year") else: print("a normal year") pB2. 閏年 (多行版)
     Like  Bookmark
  • pA. 電梯電費計算問題 for _ in range(int(input())): input() num = [int(i) for i in input().split(",")] now = num[0] ans = 0 for i in num[1::]: if now < i: ans += (i-now)*20 else:
     Like  Bookmark
  • 題目出處:點擊 pA. 找出最大和第二大的數字 for _ in range(int(input())): l=[int(i) for i in input().split()] l.sort(reverse=True) print(*l[0:2]) pB. 打印機 for _ in range(int(input())): n=list(input())
     Like  Bookmark
  • 題目出處:點擊 pA. 統計答案得分 for _ in range(int(input())): a=list(input()) ans=0 temp=1 for i in a: if i=='O': ans+=temp
     Like  Bookmark
  • pA. 計算字數及含有 s 或 S 字母的字數 for _ in range(int(input())): n = input().split() s = sum([1 for i in n if "S" in i or "s" in i]) print(str(len(n))+","+str(s)) pB. 井字棋 for _ in range(int(input())): arr = [] for i in range(3): arr.append(list(input()))
     Like  Bookmark
  • pA. 計算含有 s 或 S 字母的字數 for _ in range(int(input())): a = input().split() ans = 0 for i in a: if "S" in i or "s" in i: ans += 1 print(ans) pB. 給一個羅馬數字符號,轉為整數數字 key = {"I":1, "V":5, "X":10, "L":50, "C":100, "D":500, "M":1000}
     Like  Bookmark
  • 題目出處:點擊 pA. 二數有權重的相加 while True: try: a,b=map(int,input().split()) except: break print(4*a+6*b) pB. 閏年(多行版)
     Like  Bookmark
  • st = input() o = ["a", "A", "e", "E", "i", "I", "o", "O", "u", "U"] if(len([i for i in st[0:len(st)//2] if i in o]) == len([i for i in st[len(st)//2::] if i in o])): print(True) else: print(False) 將英文字母轉為小寫 print(input().lower()) 交錯合併字串 st1, st2 = input(), input() st3 = "" if len(st1) == len(st2):
     Like  Bookmark
  • s = input() l = len(s) ans = 0 for i in s: ans += int(i)**l print(ans == int(s)) pB. 完美數 n = int(input()) ans = 1 for i in range(2, int(n**0.5)+1):
     Like  Bookmark