原创 洛谷:P4942 小凱的數字(數學,普及/提高-)----實在找不出來哪錯了

題目: 思路: x1x2x3。。。。xn x1*(10* 。。10)+x2(10* 。。*10)+…+xn 10mod 9 =1 那麼:原式等於(x1+x2+x3+…+xn)mod9 連續的9個數mod9的結果一定爲0. 代碼

原创 洛谷:P1082 同餘方程(數學,普及+/提高)------擴展歐幾里得算法!!!

題目: 分析: ax=by+1 其中y爲整數,按照題意的要求x也爲整數。 ax+by=d,存在x,y爲整數解的必要條件是d mod gcd(a,b)=0. 在該題中,1,一定有解了。 gcd2的d參數爲a,b的最大公因子。即用g

原创 算法-數學部分-紫書-重要知識點篩選:2.計數與概率基礎

楊輝三角與二項式定理: 求二項式的係數: 組合之間的關係:

原创 洛谷:P3951 小凱的疑惑(普及/提高-,數學)

題目: 分析: a<b,我想的是首先找到連續a個可達到的,解在之前找、 大佬一號的直接數學推導方法: 代碼: #include<bits/stdc++.h> using namespace std; int main() {

原创 算法-數學部分-紫書-重要知識點篩選:1.數論部分

唯一分解定理: X2爲任意數,pi爲素數。 輾轉相除法-最大公約數: 最小公倍數: a*b/gcd(a,b) Eratosthenes篩法:構造素數表 ⊙擴展歐幾里得算法 void gcd(int a,int b,int&

原创 android studio教程-bill配套視頻代碼:6.登錄時的進度條

效果: 佈局代碼: <ProgressBar android:id="@+id/bar" android:layout_width="match_parent" android:layout_height

原创 leetcode:面試題 17.07. 嬰兒名字(並查集,代碼超時了)

題目: 分析: 並查集。 我用python寫的, 1.創建一個二維列表,然後每個列表中的元素都只有一個,爲每個名字。 2.查synonyms,匹配的名字對應的列表合併。 3.排序,求和。 竟然超時了,這道題拖了10天,答案也不好

原创 android studio教程-bill配套視頻代碼:7.菜單

效果展示: 定義菜單控件: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/andro

原创 leetcode:劍指 Offer 12. 矩陣中的路徑(圖)----大佬的pythonpython寫的很好

題目: 分析: 第一想法: 只想到了直接遍歷,沒有想到如何優化。 題解: 沒有優化,就是最基本的不匹配後的剪枝 我的c++代碼:超時,但好像沒錯吧! class Solution { public: bool f(string

原创 android studio教程-bill配套視頻代碼:4.TextView,設置和獲取文本框的值。

設置: et1.setText(""); 獲取: et1.getText().toString();

原创 android studio教程-bill配套視頻代碼:3.editview 可編輯框

1.基礎文本框 <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:maxL

原创 android studio教程-bill配套視頻代碼:5.intent實現頁面間傳值

1->2 1中代碼: intent.putExtra("username",s); 2中代碼: Intent intent=getIntent(); String s=intent.getStringExtra("username

原创 android studio教程-bill配套視頻代碼:2.對話框

對話框效果: 模板: //退出 AlertDialog.Builder tuichu_builder =new AlertDialog.Builder(MainActivity.this); tuichu_builder.set

原创 python:創建一個二維list

代碼: list=[[]for i in range(3)] 效果:

原创 android studio教程-bill配套視頻代碼:1.button,頁面跳轉,按鈕點擊事件,toast

1.基礎button代碼: <Button android:layout_width="match_parent" android:layout_height="wrap_content" android: