- 博客(34)
- 资源 (5)
- 收藏
- 关注
原创 计算机网络传输层复习要点
传输层:TCP 和 UDP三次握手(three-way handshake)第一次握手: Client将SYN置1,随机产生一个初始的序列号seq发送给Server,进入SYN_SENT状态第二次握手: 收到SYN为1之后,知道客户端请求建立连接,将自己的SYN置为1,ACK置为1,产生一个acknowledge number = sequence number + 1,并随机产生一个自己的...
2020-02-28 11:45:55 196
原创 Codeforces Round #620 (Div. 2) D. Shortest and Longest LIS
D. Shortest and Longest LIS传送门#include<cstdio>#include<algorithm>#include<cstring>using namespace std;int t,n,p[300005];char str[300005];int main(){ scanf("%d",&t); wh...
2020-02-17 21:29:10 137
原创 Codeforces Round #620 (Div. 2) C.Air Conditioner
C.Air Conditioner传送门#include<cstdio>#include<algorithm>#include<cstring>#define ll long longusing namespace std;int n;ll m,l,r,t;int main(){ int T; scanf("%d",&T); w...
2020-02-17 21:16:39 118
原创 Codeforces Round #620 (Div. 2)Two Rabbits
A. Two Rabbits传送门#include <stdio.h>typedef long long ll;int main(){ int t; ll n, m, a, b; scanf("%d",&t); while(t--) { scanf("%lld %lld %lld %lld...
2020-02-17 20:55:01 114
原创 swift 学习day4 集合类型
标题集合类型Swift 语言提供Arrays、Sets和Dictionaries三种基本的集合类型用来存储集合数据。数组(Arrays)是有序数据的集。集合(Sets)是无序无重复数据的集。字典(Dictionaries)是无序的键值对的集。Swift 语言中的Arrays、Sets和Dictionaries中存储的数据值类型必须明确。这意味着我们不能把不正确的数据类型插入其中。同时这也说明我...
2020-02-17 11:16:17 134
原创 swift学习 day3 字符串和字符
专题分为字符串字面量字面量中的特殊字符初始化空字符串字符串可变性字符串是值类型使用字符连接字符串和字符字符串插值Unicode计算字符数量访问和修改字符串子字符串比较字符串字符串的 Unicode 表示形式...
2020-02-16 23:08:58 118
原创 swift 断言和强制执行先决条件
使用断言进行调试我们可以调用 Swift 标准库的 assert(::file:line:) 函数来写一个断言。向这个函数传入一个结果为 true 或者 false 的表达式以及一条信息,当表达式的结果为 false 的时候这条信息会被显示:例子如下:import Foundationlet age = -3assert(age >= 0, "A person's age cann...
2020-02-16 23:05:48 264
原创 牛客小白月赛21 I I love you
#include <stdio.h>#include <string.h>#include <cstring>#include <iostream>using namespace std;typedef long long ll;const int mod = 20010905;const int N = 6e6 + 5;char...
2020-02-15 23:11:18 183
原创 牛客网月赛 F.Fool Problem(找规律题)
#include <stdio.h>#include <iostream>#include <vector>using namespace std;int main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); string x; cin >&g...
2020-02-15 22:53:03 270 1
原创 牛客网小白月赛21 A.Audio(三角形外心公式)
#include <iostream>#include <stdio.h>typedef long long ll;struct node{ ll x; ll y;}a,b,c; int main(){ scanf("%lld %lld",&a.x,&a.y); scanf("%lld %lld",&...
2020-02-15 22:21:46 126
原创 swift 学习day2 基本运算符
运算符是检查、改变、合并值的特殊符号或短语。例如,加号(+)将两个数相加(如 let i = 1 + 2)。更复杂的运算例子包括逻辑与运算符 &&(如 if enteredDoorCode && passedRetinaScan)。Swift 支持大部分标准 C 语言的运算符,且改进许多特性来减少常规编码错误。如:赋值符(=)不返回值,以防止把想要判断相等运算符(...
2020-02-14 21:54:27 256
原创 Swift学习 day1 基础部分
Swift 是一门开发 iOS, macOS, watchOS 和 tvOS 应用的新语言。然而,如果你有 C 或者 Objective-C 开发经验的话,你会发现 Swift 的很多内容都是你熟悉的。Swift 包含了 C 和 Objective-C 上所有基础数据类型Int表示整型值;Double 和 Float 表示浮点型值;Bool 是布尔型值;String 是文本型数据。Sw...
2020-02-14 21:51:37 138
原创 Mac 的 ⌘ ⌥ ⇧ ^按键
Mac 的 ⌘ ⌥ ⇧ ^按键⌘ ⌥ ⇧ ^⌘ command键⌥ option/alt⇧ shift按键^ 表示的是control键
2020-02-13 22:34:23 593
原创 Comet OJ - 模拟赛 #2 A
传送门样例输入 15 31 2 3 4 52 1 51 5 22 1 5样例输出 11519#include<bits/stdc++.h>#define maxn 100005#define LL long long#define S 300using namespace std;int n,q;int pr[maxn],vis[maxn],cnt_p...
2020-02-08 20:44:52 132
原创 小 C 的 01 序列
传送门#include<bits/stdc++.h>#define maxn 100010using namespace std;int d[4]={0,1,0,0};int n;int main(){ cin>>n; for(int i=2;i<=n;i++){ if(i&1){ d[0]=d[0]<<1|1; ...
2020-02-05 19:49:58 266
原创 小 C 的数论习题
暴力就好了#include<bits/stdc++.h>using namespace std;int a,b,c;int main(){ cin>>a>>b>>c; for(int i=1;;i++){ if(i%23==a&&i%233==b&&i%2333==c){ cout<<...
2020-02-05 19:46:48 150
原创 重心拉格朗日插值法 (板子)
拉格朗日的作用就是给你 n+1 个点,让你构造出一个 n 次函数,使得这个函数的图像经过坐标轴上的 n+1 个点。重心拉格朗日插值法优化到O(n)O(n*n)#include<iostream>#include<cstdio>#define ll long longusing namespace std;const int M=2111;const ll...
2020-02-05 19:23:19 1770
原创 拉格朗日插值法
拉格朗日插值公式指的是在节点上给出节点基函数,然后做基函数的线性组合,组合系数为节点函数值的一种插值多项式。线性插值也叫两点插值,已知函数y = f (x)在给定互异点x0, x1上的值为y0= f (x0),y1=f (x1)线性插值就是构造一个一次多项式:P1(x) = ax + b,使它满足条件:P1 (x0) = y0, P1 (x1) = y1其几何解释就是一条直线,通过已知点A ...
2020-02-05 19:16:30 1374
原创 ICPC_Number Game(博弈)
Number Gamedescription:Alice and Bob are playing a game on a line of N squares. The line is initially populated with one of each of the numbers from 1 to N. Alice and Bob take turns removing a singl...
2020-02-04 20:49:58 268
原创 Majority ICPC_Pacific Northwest Region Programming Contest基础题
Problem N— limit 5 secondsThe votes are in! Mathematicians world-wide have been polled, and each has chosen their favorite number between 1 and 1000. Your goal is to tally the votes and determine wh...
2020-02-04 11:31:10 208
原创 a[i]++ 和 a[i++]的区别
a[i]++指的是把a[i]看成一个整体变量x, x++,一般用数组方便存储,有特殊的作用.a[i++]是指向下一个元素的元素.
2020-02-04 11:28:27 3045
原创 LJJ爱数数(莫比乌斯反演)
传送门题意:给定n,求满足1/a+1/b=1/c,求a,b,c互质的三元组(a,b,c)数目。(a,b,c≤n)n≤10的12次方.后补
2020-02-02 21:19:38 147
原创 F - LJJ王国的数学家(dfs简单递归入门)
F - LJJ王国的数学家Description想要成为LJJ王国的数学家,你要秒切这样一个问题:给定n和k,输出k个非负整数加和等于n的所有方案。(按字典序)Input两个整数分别为n和k。(0<k<=n<=10)Output按字典序输出所有方案。SampleInput3 3Output3=0+0+33=0+1+23=0+2+13=0+3+03=1...
2020-02-02 20:32:12 133
原创 王国的婚礼(被水题坑了一波)
王国的婚礼Description在LJJ王国里,婚姻法规定,结婚后不许离婚,但可以选择婚姻年限 1 到 100 年,过期不续费就相当于自动离婚,但是时间越短费用越高,1 年的登记费超过 1 万亿元,100 年只需要6元。结婚一年,说明你不懂婚姻,于是有一本很厚的婚姻书要看,而选择100年只有一张纸,上面写着一句:祝你们白头偕老!假设选择的婚限年限为 a 年,需要交的登记费为如下公式。In...
2020-02-02 20:20:10 358
原创 Happy Birthday (Codeforces思维➕枚举)
Happy Birthday#include <bits/stdc++.h>using namespace std;const int N = 1e6+5;int a[11];int main(){ int n; cin>>n; for(int i = 0 ; i < n ; i ++) { for (i...
2020-02-01 21:33:05 219
原创 A. Berstagram icpc(用数组模拟)
A. Berstagramtime limit per test3 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputPolycarp recently signed up to a new social network Berstagram. He immediate...
2020-02-01 21:05:16 306
原创 F - Data Center codeforces补题(应该有更好的方法)
You are developing a project to build a new data center. The data center will be a rectangle with an area of exactly n square meters. Each side of the data center must be an integer.Your goal is to m...
2020-02-01 20:28:48 216
ChineseNumberIdentify-master.zip
2020-06-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人