09 2022 档案

摘要:# **6-1 顺序表实现** ```cpp int ListLength(SqList L){ return L.length; } int LocateElem(SqList L , ElemType e , Status (*compare)(ElemType , ElemType) ){ / 阅读全文
posted @ 2022-09-19 01:09 PHarr 阅读(312) 评论(0) 推荐(0)
摘要:A. PENTA KILL! 把每个一个人的击杀序列分开,判断是否有连续五个不同的击杀就好 #include<bits/stdc++.h> using namespace std; map<string , vector<string> > st; int32_t main(){ int n; ci 阅读全文
posted @ 2022-09-19 01:03 PHarr 阅读(467) 评论(0) 推荐(0)
摘要:A 公园门票 简单的计算题 #include<bits/stdc++.h> #define int long long using namespace std; int read() { int x = 0, f = 1, ch = getchar(); while ((ch < '0' || ch 阅读全文
posted @ 2022-09-13 15:40 PHarr 阅读(757) 评论(0) 推荐(0)
摘要:A - Middle Letter #include<bits/stdc++.h> using namespace std; int32_t main() { string s; cin >> s; cout << s[ (s.size()+1) / 2 - 1 ]; return 0; } B - 阅读全文
posted @ 2022-09-13 15:04 PHarr 阅读(70) 评论(0) 推荐(0)
摘要:A - Saturday #include<bits/stdc++.h> using namespace std; int32_t main() { string s; cin >> s; if( s == "Monday" ) cout << "5\n"; if( s == "Tuesday" ) 阅读全文
posted @ 2022-09-13 14:39 PHarr 阅读(44) 评论(0) 推荐(0)
摘要:A - Full House #include<bits/stdc++.h> using namespace std; int read() { int x = 0, f = 1, ch = getchar(); while ((ch < '0' || ch > '9') && ch != '-') 阅读全文
posted @ 2022-09-13 14:09 PHarr 阅读(102) 评论(0) 推荐(0)
摘要:A 2020 一个简单的 DP,f[i]表示前i位最多能选择的子串个数。 转移首先不选可以得到f[i] = f[i-1],其次如果当前的后缀是2020的话就f[i] = max( f[i] , f[i-4]+1) #include<bits/stdc++.h> using namespace std 阅读全文
posted @ 2022-09-12 16:52 PHarr 阅读(86) 评论(0) 推荐(0)
摘要:A 阿宁的柠檬 签到 #include<bits/stdc++.h> #define int long long using namespace std; int32_t main() { int a , b , n; cin >> a >> b >> n; cout << n << " " << 阅读全文
posted @ 2022-09-08 19:23 PHarr 阅读(47) 评论(0) 推荐(0)
摘要:# **6-1 递归法求Fibonacci数列第n项的值** 这道题就是写一个简单的递归函数即可 ```cpp int fun( int n ){ if( n == 1 || n == 2 ) return 1; return fun(n-1) + fun(n-2); } ``` # **6-2 分 阅读全文
posted @ 2022-09-08 00:19 PHarr 阅读(224) 评论(0) 推荐(0)
摘要:https://codeforces.com/contest/1725 阅读全文
posted @ 2022-09-06 21:30 PHarr 阅读(159) 评论(0) 推荐(0)
摘要:# 计算机网络在信息时代中的应用 Internet是全球最大最重要的计算机网络 中文译名互联网、因特网。注意互联网≠互连网 互联网的两个重要基本特点**连通性**和**资源共享** # 互联网概述 **计算机网络的定义**,计算机网络是由若干结点和连接节点的链路组成的 互联网(Internet),互 阅读全文
posted @ 2022-09-05 21:52 PHarr 阅读(302) 评论(0) 推荐(0)
摘要:# 定义 **数据结构**:带**结构**的数据元素的集合 # 数据的逻辑结构 数据的逻辑结构可以归为四类 1. 线形结构,一个前驱一个后继 2. 树形结构,一个前驱多个后继 3. 图形结构,多个前驱多个后继 4. 集合结构,元素直接无直接关系的 # 数据的存储结构 数据的存储结构: 1. 顺序存储 阅读全文
posted @ 2022-09-05 21:13 PHarr 阅读(44) 评论(0) 推荐(0)
摘要:6 题 vp 排名 54/253 铜,现场排名22/152银 感觉浙江省的 acm 强度继承了浙江 oi 强度还是很高的 A. Hello, ACMer! 这题就是找到hznu的个数 #include<bits/stdc++.h> using namespace std; int32_t main( 阅读全文
posted @ 2022-09-01 21:22 PHarr 阅读(275) 评论(0) 推荐(0)
摘要:# 6-1 最大子段和 因为是字段和,所以要尽可能的多加,如果在加的过程中当前和为负数时,往后累加一定不会比保留当前值更优秀,所以要把之前的部分抛弃重新累加 ```cpp int mis(int a[], const int n) { int res = 0 , sum = 0 ; for( int 阅读全文
posted @ 2022-09-01 16:39 PHarr 阅读(206) 评论(0) 推荐(0)