4.18騰訊云智筆試
題目簡單 筆試頭一次ak 期待面試
接好運
題目分享:20道選擇題,兩道算法題,一道SQL題
##Q1 import collections s=input() ans=0 temp='ABCDEFGHIGKLMNOPQRSTUVWXYZ' cnt=collections.defaultdict(int) for ss in s: cnt[ss]+=ord(ss) for tt in temp: if cnt[tt]==0: ans += ord(tt) print(ans) ##Q3 from math import inf #s = input() s = 'acmmer' def compare(ss: str) -> int: ex = 'AcMer' ansss = 0 for i in range(5): if ss[i] == ex[i]: ansss += 0 elif abs(ord(ss[i]) - ord(ex[i])) == 32: ansss += 5 elif 65 <= ord(ss[i]) <= 90 and 65 <= ord(ex[i]) <= 90: ansss += 5 elif 97 <= ord(ss[i]) <= 122 and 97 <= ord(ex[i]) <= 122: ansss += 5 else: ansss += 10 return ansss ans = inf n = len(s) left = 0 tmp = 0 for right in range(4, n): if right - left + 1 != 5: break ans = min(ans, compare(s[left:right + 1])) left += 1 print(ans)
SQL
SELECT c.tag AS tag, ROUND(SUM(TIMESTAMPDIFF(MINUTE,p.start_time,p.end_time)),3) AS time_len, ROUND(AVG(score),3) AS avg_score FROM course_info_tb c INNER JOIN play_record_tb p ON c.cid=p.cid GROUP BY c.tag ORDER BY c.cid;#筆試##騰訊云智研發(fā)2025實習(xí)生招聘#