原创 牛客編程語言練習賽第六場

Powered by:AB_IN 局外人 水一波博客。 A kiki算數 while True: try: a,b=map(int,input().split()) c=str(a+b)[-

原创 牛客算法週週練13水題

Powered by:AB_IN 局外人 A 最小生成樹 貪心算法,最小的數當父節點,其他數均爲子節點。 n = int(input()) a = list(map(int,input().split())) a.sort() p

原创 並查集配套例題

Powered by:AB_IN 局外人 P1536 村村通 這個題就是給了你一些現有的路線,問還需要多少將它們都連起來? 其實就是問父節點之間的連線。 父節點的個數−1父節點的個數-1父節點的個數−1即可。 #include <

原创 5.24 第十五屆中北大學ACM競賽水題題解

Powered by:AB_IN 局外人 A 俄羅斯方塊 純模擬,座標顛倒要注意,數組座標和題目座標不一樣。 #include<bits/stdc++.h> #pragma GCC optimize(2) #pragma GCC

原创 5.18 第二次課直播總結

Powered by:AB_IN 局外人 5.18 直播總結。 一、快排模版 ~~ void quick_sort(int a[],int l ,int r) { int i=l,j=r; int mid=(l+r

原创 牛客練習賽65水題

Powered by:AB_IN 局外人 A 最值序列 純模擬題。 mod=998244353 n=int(input()) s=list(map(int,input().split())) s.sort() if n&1:

原创 哈爾濱理工大學軟件與微電子學院程序設計競賽水題

Powered by:AB_IN 局外人 只會這些題了。。 A Race 模擬就okokok。 #include <bits/stdc++.h> using namespace std; int main() { int v1,

原创 jtq的筆 && pb的苦惱

Powered by:AB_IN 局外人 jtq的筆 單純的模擬。 題目什麼意思呢? 求字符串中一個非前綴子串恰好爲字符串的前綴的最大長度。 下面是簡單的模擬 t=int(input()) while t>0: t-=1

原创 牛客編程語言練習賽第三場

Powered by:AB_IN 局外人 沒錯,我來水博客了。。。 B 學生基本信息輸入輸出 Py3 a, b = input().split(';') c, d, e = map(float, b.split(',')) c +

原创 Py3 翻譯問題+replace

Powered by:AB_IN 局外人 P1914 小書童 一個翻譯的水題,用套版就行了。 while True: try: n=int(input()) s=input()

原创 牛客算法週週練11水題

Powered by:AB_IN 局外人 第一次練習賽AK。 A 切題之路 純模擬,沒什麼好說的。 #include <bits/stdc++.h> #pragma GCC optimize(2) #pragma GCC opti

原创 Py3 約瑟夫環的實現

Powered by:AB_IN 局外人 P1283: 【出圈】 掛一下經過老師的代碼優化過的PY代碼 while True: try: n,m=map(int,input().split())

原创 小白學並查集(帶製作)

Powered by:AB_IN 局外人 首先什麼是並查集? 並查集,在一些有N個元素的集合應用問題中,我們通常是在開始時讓每個元素構成一個單元素的集合,然後按一定順序將屬於同一組的元素所在的集合合併,其間要反覆查找一個元素

原创 北華大學第五屆程序設計競賽春季聯賽水題

Powered by:AB_IN 局外人 A 遺忘的泰勒 t=int(input()) while t>0: t-=1 n=int(input()) if n&1: print("YES")

原创 Py3 字符串水題

Powered by:AB_IN 局外人 科大訊飛杯 B題 題目描述 勇士菜哭武獲得了一把新的武器,武器有特殊的傷害計算方式。武器的傷害計算方式由若干個部分的和組成,用+號連接。每一部分可以是一個整數a,或者是一個公式ndx。其中