Loading

摘要: A.小林找工作 #include<bits/stdc++.h> using namespace std; const int MAXN=1e5+10; int p[MAXN]; int main() { int n,m; cin>>n>>m; for(int i=1;i<=n;i++) { scan 阅读全文
posted @ 2020-12-15 17:17 Do1phln 阅读(118) 评论(0) 推荐(0)
摘要: A. 三角形面积 #include <bits/stdc++.h> using namespace std; int main() { double a,b,c; double ans,p,tmp; cin>>a>>b>>c; p=(a+b+c)*0.5; tmp=p*(p-a)*(p-b)*(p- 阅读全文
posted @ 2020-12-15 17:16 Do1phln 阅读(144) 评论(0) 推荐(0)
摘要: P2031凯撒密码 #include<bits/stdc++.h> using namespace std; int main(){ string s; int d; while(cin>>s) { cin>>d; int len=s.length(); for(int i=0;i<len;i++) 阅读全文
posted @ 2020-12-15 17:14 Do1phln 阅读(125) 评论(0) 推荐(0)
摘要: 题目 给定一个数组和一个数s,在这个数组中找一个区间,使得这个区间之和等于s。 例如:给定的数组int x[14] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14};和一个s = 15。那么,可以找到的区间就应该有0到4, 3到5, 6到7.(注意这 阅读全文
posted @ 2020-12-15 17:13 Do1phln 阅读(145) 评论(0) 推荐(0)
摘要: 同样一个问题,位运算可以提高程序的运行效率。 下面讲一下关于奇偶性的判断。 常规方法 public static boolean isOdd(int i){ ​ return i % 2 != 0; } 位运算方法 public static boolean isOdd(int i){ ​ retu 阅读全文
posted @ 2020-12-15 17:11 Do1phln 阅读(162) 评论(0) 推荐(0)
摘要: 概念解释 PHP 反序列化漏洞又叫做 PHP 对象注入漏洞,我觉得这个表达很不直白,也不能说明根本的问题,不如我们叫他 PHP 对象的属性篡改漏洞好了(别说这是我说的~~) 反序列化漏洞的成因在于代码中的 unserialize() 接收的参数可控,从上面的例子看,这个函数的参数是一个序列化的对象, 阅读全文
posted @ 2020-12-15 17:08 Do1phln 阅读(313) 评论(0) 推荐(0)
摘要: 问题 DPL_3_A: Largest Square #include<iostream> #include<algorithm> #include<cstdio> using namespace std; #define MAX 1400 int dp[MAX][MAX], G[MAX][MAX] 阅读全文
posted @ 2020-12-01 22:16 Do1phln 阅读(155) 评论(0) 推荐(0)
摘要: DPL_1_A: Coin Changing Problem 每次均有两种选择,即选择当前的,即为在当前状态+1,否则维持原来的T[j+d[i]] #include<iostream> #include<cstdlib> #include<cstring> using namespace std; 阅读全文
posted @ 2020-12-01 22:14 Do1phln 阅读(89) 评论(0) 推荐(0)
摘要: AOJ-ALDS1_1_D Maximum Profit 本题主要考虑要将复杂度降到O(n),否则过不了最后五组数据 #include<iostream> #include<bits/stdc++.h> using namespace std; int main(){ int n,maxv=-1e1 阅读全文
posted @ 2020-12-01 22:13 Do1phln 阅读(136) 评论(0) 推荐(0)
摘要: 好久没见过CF有这么水的contest了,蒟蒻赶紧找找自信 A. Subtract or Divide #include<iostream> using namespace std; int main(){ int T,n; cin>>T; while(T--) { cin>>n; if(n<=3) 阅读全文
posted @ 2020-12-01 22:11 Do1phln 阅读(98) 评论(0) 推荐(0)
摘要: GCD,LCM 定理 a、b两个数的最大公约数乘以它们最小公倍数等于a和b的乘积 axb=GCD(a,b)xLCM(a,b) 据此定理,求3与8的最小公倍数可以为:LCM(3,8)=3x8divGCD(3,8)=24 欧几里得算法 构造关系:GCD(a,b)=GCD(b, a mod b) int 阅读全文
posted @ 2020-12-01 22:10 Do1phln 阅读(237) 评论(0) 推荐(0)
摘要: 前言 近期发现我NEFU低年级组校赛题目只有模拟+数论,恰恰都是我最不会做的,数论方面反反复复用到的就是素数筛,特在此记录一下,闲来无事自己翻阅当作复习复习,以免被到时候一道题都做不出来菜到巨佬们。 代码 查找2-N的所有素数,如下 //线性筛 void init() { phi[1] = 1; f 阅读全文
posted @ 2020-12-01 22:09 Do1phln 阅读(117) 评论(0) 推荐(0)
摘要: 本人随便乱写,目前正确性未知 C.本质上升序列 #include<bits/stdc++.h> using namespace std; bool access[4][4]; int dfs(int idx, int x, int y) { if(x<0 || y<0 || x>=4 || y>=4 阅读全文
posted @ 2020-12-01 22:07 Do1phln 阅读(247) 评论(0) 推荐(0)
摘要: #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> using namespace std; const int maxn = 100 + 5; char piece[maxn][maxn]; int n,m 阅读全文
posted @ 2020-11-10 20:02 Do1phln 阅读(75) 评论(0) 推荐(0)
摘要: 逆向考虑即可解决 #include<iostream> using namespace std; const int maxn= 100000 +5; int a[maxn][4];//0-x,1-y,2-x-length,3-y-length int main(){ int n,flag=0; c 阅读全文
posted @ 2020-11-10 19:04 Do1phln 阅读(84) 评论(0) 推荐(0)