1. 程式人生 > 其它 >2022.4.17周學習總結

2022.4.17周學習總結

一、本週學習進度

  1.java專案登入介面完善了, 能實現密碼正確是否的判斷

  2.註冊介面寫了正則判斷是否有效

  3.登入進去能夠聊天了,但是還沒有介面。

  4.資料庫工具包,IO流工具包寫好了

  5.服務端採用了多執行緒的執行緒池啟動執行緒

  6.找回密碼功能已經完善

  7.題組刷到了20個

二、本週打比賽及補題情況

  1.CFedu126

  這場打的不是很理想,最後三分鐘才寫出來第二個題。差點掉分。

  

 

   這個B題,剛開始想著跑bfs,超時了,然後dfs也寫超時了,搜尋還是不太行,最後寫了個dp過掉了

  C題比賽的時候沒時間看,比完賽去看,一眼看出來是二分,只不過細節很多,沒有處理到位,最後看別人的程式碼學了一手列舉+二分。

  程式碼實現:

 1 #include <iostream>
 2 #include <queue>
 3 #include <vector>
 4 #include <cstring>
 5 #include <string>
 6 #include <map>
 7 #include <cmath>
 8 #include <algorithm>
 9 #include <set>
10 #include <stack>
11 #include <cstdio>
12
#include <climits> 13 #define PII pair<int,int> 14 #define rep(i,z,n) for(int i = z;i <= n; i++) 15 #define per(i,n,z) for(int i = n;i >= z; i--) 16 #define ll long long 17 #define db double 18 #define vi vector<int> 19 #define debug(x) cerr << "!!!" << x << endl; 20
using namespace std; 21 inline ll read() 22 { 23 ll s,r; 24 r = 1; 25 s = 0; 26 char ch = getchar(); 27 while(ch < '0' || ch > '9'){ 28 if(ch == '-') 29 r = -1; 30 ch = getchar(); 31 } 32 while(ch >= '0' && ch <= '9'){ 33 s = (s << 1) + (s << 3) + (ch ^ 48); 34 ch = getchar(); 35 } 36 return s * r; 37 } 38 inline void write(ll x) 39 { 40 if(x < 0) putchar('-'),x = -x; 41 if(x > 9) write(x / 10); 42 putchar(x % 10 + '0'); 43 } 44 bool cmp(int p,int k) 45 { 46 return p > k; 47 } 48 ll a[300010]; 49 int n; 50 ll ans; 51 ll check(int val) 52 { 53 ll c1 = 0; 54 ll c2 = 0; 55 rep(i,1,n) { 56 c1 += (val - a[i]) % 2; 57 c2 += (val - a[i]) / 2; 58 } 59 ll c = 0; 60 if(c2 >= c1 + 2) 61 c = (c2 - c1 - 2) / 3 + 1; 62 return max((c1 + 2 * c) * 2 - 1,(c2 - c) * 2); 63 } 64 int main() 65 { 66 int t; 67 ios::sync_with_stdio(false); 68 cin >> t; 69 while(t--){ 70 cin >> n; 71 ll mk = -1; 72 ans = 1e18; 73 rep(i,1,n) { 74 cin >> a[i]; 75 mk = max(mk,a[i]); 76 } 77 rep(i,0,1) ans = min(ans,check(mk + i)); 78 cout << ans << endl; 79 } 80 return 0; 81 }

三、下週學習計劃

  1.把專案的聊天介面寫出來

  2.學一手加密演算法,以及加好友等功能瞭解

  3.發訊息等功能把檔案圖片等實現以下

  4.備戰一下天梯賽把,快要打了,不想拖後腿

四、本週總結

  這周是專案和題組雙開的一週,很折磨,前面還能平均每天開兩道題,後面基本上一天都不一定能寫出來一個題,還得週六週日去補,專案那邊也只能抽空去學。搜尋方面也雀氏學了很多東西,比如說狀壓搜尋,康拓狀壓,狀壓dp,剪枝技巧等搜尋技巧,學完之後還是挺滿足的。希望下週加油把~~~QAQ