自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Harukaze

波克波克

  • 博客(111)
  • 收藏
  • 关注

原创 DOTween 动画使用实例总结

DOKILL 的使用:在一些动画无法正常播放完毕时,比如:关闭动画播放页面等操作,会导致Tween动画对象不会主动销毁。这时需要手动使用DOKILL命令来停止与销毁对象。当然,如果需要通过什么手段提前结束DoTween动画也可以主动调用DOKILL。DoTween 动画回调带参数的函数。播放多个组合衔接动画。

2023-08-07 17:22:38 375

原创 关于__declspect(dllexport) 和 __declspec(dllimport)的使用

__declspec(dllexport)声明一个导出函数,是说这个函数要从本dll中导出,提供给别人用。省掉在DEF文件中手工定义导出哪些函数的一个方法。当然,如果你的DLL里全是C++类的话,你无法在DEF里指定导出函数,这时候就只能使用__declspect(dllexport)导出类__declspect(dllimport)声明一个导入函数,是说这个函数是从别的DLL导入。我要用。一般用于使用某个dll的exe中不使用__declspect(dllimport)也能正确编译代码,但使用_

2021-06-03 18:11:41 639

原创 球体的顶点绘制与纹理坐标的转换

预备知识:基础三角函数sin 、cos、方位角、仰角方位角:the angular distance usually measured clockwise from the north point of the horizon to the intersection with the horizon of the vertical circle passing through a celestial body — from WiseDictionary意思就是说水平圆片的角θ\thetaθ 范围 是

2021-05-14 10:08:13 1063 3

原创 开发学习笔记——初识P3D

P3D,Prepar3D 是一款由Lockheed Martin公司开发的军队训练仿真软件。私人飞行员,商业组织,学术学会以及军队都依赖于Prepar3D进行沉浸式学习。P3D是可视化的仿真平台,并允许用户创造包括航空,海洋和大陆领域的任何场景。P3D从根本上来说是数据驱动的,可以增加或者修改场景中的数据,模型。其SDK组件提供了强大的支持。...

2021-04-20 15:39:50 3243

原创 字符串与数字的相互转换

#include <stdio.h>#include <string.h>int main(){ int num = -150; char str[128]; int rsl; // 数字转字符串 sprintf(str, "%d", num); // 字符串转数字 sscanf(str, "%d", &rsl); printf("%s\n", str); printf("%d\n", rsl);

2021-03-29 16:57:36 109

原创 register int 与 int的区别

register 是表示使用cpu内部寄存器(寄存器是中央处理器内的组成部分。寄存器是有限存贮容量的高速存贮部件)的变量,而平时的int是把变量放在内存中,存到寄存器中可以加快变量的读写速度。for (register int i = 1; i < n; i++ ){ a[i+1] = a[i] + a[i-1];}...

2020-12-20 17:51:51 1156

转载 C++智能指针学习笔记

原文:https://www.cnblogs.com/WindSun/p/11444429.html摘录智能指针auto_ptr, unique_ptr,shared_ptr, weak_ptr智能指针的作用是管理一个指针,因为存在一下的情况: 申请的空间再函数结束时忘记释放,造成内存泄漏。使用智能指针可以很大程度上的避免这个问题,因为智能指针是一个类,当超出了类的实例对象的作用域时,会自动调用对象的析构函数,析构函数会自动释放资源。所以智能指针的作用原理就是再函数结束时自动释放内存空间,不需要手动

2020-12-18 18:06:46 110

原创 计算几何基础———— 空间向量的基本运算重载,点乘和叉乘

定义向量以OSG (OpenSceneGraph)为例定于向量的数据类型 typedef float value_type向量的维度 enum{num_components = 3; //这里以三维为例子}三维向量的各个分量可以用一维数组表示 ; value_type _v[3];##重载运算符 :重载等于inline bool operator == (const Vec3f& v) const { return _v[0] == v._v[0] && _v[

2020-11-30 17:15:11 1840

原创 C++ 工程类学习笔记(一)

C++基本工程规范工程创建工程创建环境: VS 20171、建立解决方案,可采用全英文小写命名2、项目采用驼峰命名法,项目可以创建多个,但都需要采用全英文,且不能重复和产生歧义3、源文件必须分为至少一个头文件和一个.cpp文件 ,在头文件中#include所有需要支持库文件,创建一个命名空间(命名空间名无特定要求与),创建一个类, 如果需要生成.dll 需要添加__declspec(dllexport) ,可以使内部对外接口封闭。4、在头文件中, 同时需要注明Public : Privat

2020-11-30 14:10:28 288

原创 计算二维平面平行线段之间的距离

#include<iostream>#include<vector>using namespace std;#define eps 1e-3float a1[5][3] = { 0.972, 0.2137, 9.23, 21.32,23.873,83.823, 0.972, 0.2137, 9.23, 21.32,23.873,83.823, 0.972, 0.2137, 9.23};float a2[5][3] = { 0.972, 0.21

2020-11-27 00:32:39 586

原创 Python 代码标准结构

#/usr/bin/env/ python      #(1) 起始行#"this is a test module"      #(2) 模块文档(文档字符串)import sysimport os              #(3) 模块导入debug = True            #(4) (全局)变量定义class FooClass (object...

2020-01-17 17:30:54 313

原创 字符三角形

字符三角形问题问题描述:符号三角问题:下图是由14个“+”和14个“-”组成的符号三角形。2个同号下面都是“+”,2个异号下面都是“-”。在一般情况下,符号三角形的第一行有n个符号。符号三角形问题要求对于给定的n,计算有多少个不同的符号三角形,使其所含的“+”和“-”的个数相同。解题思路:一个符号三角形最终是否有相同数量的+ - 只取决于第一行中+ - 全排列。故对第一行n个数 0 ...

2019-12-23 22:07:05 1065

原创 C++ 11中可以用auto

比起普通的循环,这种写法真的很方便呢!#include<iostream>#include<vector>using namespace std;int main(void){//数组和vector都可以被auto 识别类型 //int arr[10]; vector<int> arr(10); for (int i = 0; i &l...

2019-09-11 10:31:09 168

原创 PAT-2019年秋季考试-甲级

总分: 80 / 100编程题总分: 80 / 1007-1 Forever未作答 得分: 0 / 20“Forever number” is a positive integer A with K digits, satisfying the following constrains:the sum of all the digits of A is m;the sum of all ...

2019-09-10 22:52:20 705

原创 2018"百度之星"程序设计大赛 - 初赛

/** @Author: Achan* @Date: 2019-08-16 22:00:16* @Last Modified by: Achan* @Last Modified time: 2019-08-17 00:04:24*/#include<bits/stdc++.h>using namespace std;int main(void){ in...

2019-08-17 00:08:44 197

原创 PAT (甲级) 1010 Radix (二分)

#include<bits/stdc++.h>using namespace std;typedef long long LL;string s[3];LL N[3],ans = -1;inline int toNum(char c){ if(c>='0' && c<='9') return c - '0'; return c -...

2019-08-16 13:58:50 179

原创 PAT(甲级) 1009 Product of Polynomials (简易模拟)

#include<iostream>#include<iomanip>#include<string>#include<vector>#include<cmath>using namespace std;const int maxn = 1000 + 5;typedef struct { int exp; float c...

2019-08-13 13:59:43 118

原创 PAT(甲级) 1006 (串的大小比较)

开始还在想着模拟做。。?这TM的串格式固定,直接比较!!!#include<iostream>#include<string>#include<map>#include<vector>using namespace std;int main(void){ int n; cin >> n; //int st = 24 *...

2019-08-12 00:22:40 169

原创 PAT(甲级)1007 (简单最大序列和)

由于题中只要求了subsequence 子序列的最大和(不是子串),那么这道题就不用做得太麻烦了。简单维护一下最大不定前缀和即可。坑点:题中只说全负数时直接取零,这意味着在序列中出现0是要记录的。学习到了:1、以后还是多注意下读题吧。多读一分钟,节约找bug时间10分钟。。。2、第一次使用scanf(), 在PAT的诡异测评机下居然报警告!解决办法是if(scanf()) {}#i...

2019-08-12 00:18:02 395

原创 PAT(甲级) 1005 (简易模拟)

#include<iostream>#include<cstdio>#include<stdio.h>#include<string.h>#include<string>#include<map>using namespace std;map<char, string> alp;void init(...

2019-08-09 23:39:23 211

原创 PAT(甲级) 1004 (树的遍历简易DFS))

读题太死了,虽然通常情况下01 02 这类输入需要用字符串作为输入,但。。。这题直接当int搞就行了,测评机输入的是“真整数”。我学到了:再一次领悟到了map vector 万能嵌套的魅力~没搞懂的地方是:还有,VS老是报错vector越界??? 我开100,用一个ans[0] (VS: 不行不行,你越界)---------------------------------------...

2019-08-08 22:08:30 209

原创 PAT(甲级)1003 Emergency (最短路)

只需在Dijkstra最短路径的维护过程中,附带更新“等路径长条数”以及“最多的队伍人手”,即可。熟悉了链式向前星建立无向图,但要注意maxn至少是边的四倍!这里数据500比较小可以直接取平方优先队列维护pair最小堆虽然用得比较多,但需要熟悉下最简单方法。/** @Author: Achan* @Date: 2018-10-26 17:58:34* @Last Modified ...

2019-08-07 21:42:20 158

原创 1002 A+B for Polynomials

题目中虽然没有说明指数到底是不是整型,但最好在比较大小时用精度比较。后来看题解才发现都是用的整型,数组一存就完事了。学到了:浮点型精度比较时采用 fabs(f - a) < 1e-x 达到精度范围就可以说明接近程度可看作近似相等。同理若是用 > 则表明近似不等关系/** @Author: Achan* @Date: 2019-08-06 11:39:15* @Last ...

2019-08-06 12:41:37 121

原创 PAT 甲级 1001 A+B Format(暴力)

初次做法:每次取三位存一下再按顺序格式输出,相对通用化。学习到了C和C++不同的格式输出方法。C: printf("%03d",a); //三位数,以0前导填充C++: cout << setw(3) << setfill(‘0’) << a ;int main(void){ io int a,b; cin >> a >&...

2019-08-06 11:25:44 103

原创 常用的函数形参,实参传递

首先, 给出接触C语言来的第一次函数参数传递遇到的bugvoid swap(int x,int y) //自动建立新的临时变量作为形参,与实际值无关{ int temp; temp=x; x=y; y=temp;}int main(){ int a = 5, b = 3; swap(a,b); return 0;}由于传递的是形参,不会改变a,b的值!要改变a,...

2019-08-04 23:22:00 334

原创 计数排序

#include<bits/stdc++.h>using namespace std; /* *计数排序:A和B为待排和目标数组,k为数组中最大值,len为数组长度 */ /* 实际上就只是从1到n统计出现数的个数的前缀,这即是顺序。从后往前取数是为了令相同的数保持原顺序,实现算法的稳定性*/void CountingSort(std::vector<int&...

2019-08-04 21:13:45 103

原创 E. Two Arrays and Sum of Functions (math + greedy)

题目链接统计求和公式中每个a[i]b[i]对答案的贡献,每个位置i会提供的(i+1)(n-1-i)次,题目要求只能移动b数组,故可用贪心思想:将a[i](i-1)(n-1-i) 较小的 * b[i]中较大的,相当于对每个固定不动的a[i]都找一个最佳的b[i]匹配,简单排序即可实现。/** @Author: Achan* @Date: 2019-05-15 21:34:08* @La...

2019-05-16 17:44:04 149

原创 最长单调递增子序列

复制后排序去重,用O(n^2)的最长公共子序列动态规划算法求解。爆搜一个解输出。/** @Author: Achan* @Date: 2019-05-04 19:46:27* @Last Modified by: Achan* @Last Modified time: 2019-05-05 17:10:44*/int main(void){ // fin int ...

2019-05-05 18:09:48 180

原创 快速求 n 个数的最大公约数gcd( a[] )

priority_queue<ll,vector<ll>,greater <ll> > q; for (int i = 1; i < n; ++i) { // se.insert(x[i] - x[i-1]); q.push(x[i] - x[i-1]); } //ex_gcd ll mx_gcd = 1; while(1){ ...

2019-05-01 20:59:25 3171

原创 数学题型取模mod需注意的问题 ( Codeforces Round #553 (Div. 2) C - Problem for Nazar)

应用于对负数ans求模ans =(ans + mod) %mod;可以在输出答案时添上+mod防止负数的产生,并且对答案无影响(数论上可证明)点我进入测试题/** @Author: Achan* @Date: 2019-04-19 23:01:30* @Last Modified by: Achan* @Last Modified time: 2019-04-20 00:0...

2019-04-20 00:14:58 261

原创 Codeforces Round #552 (Div. 3) E - Two Team(set 优先容器)

#include<bits/stdc++.h>using namespace std;int main(void){ std::ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; set <int, greater<int> > se;//优先...

2019-04-18 11:25:06 185

原创 Codeforces Global Round 2

Codeforces Global Round 2B - Alyona and a Narrow Fridge(贪心)#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(void){ cin.tie(0); // freopen(“in.txt”,“r”,stdin); //...

2019-04-07 11:19:48 832

原创 Vector 的简单用法

/** @Author: Achan* @Date: 2019-04-06 22:39:50* @Last Modified by: Achan* @Last Modified time: 2019-04-06 23:22:19*/#include<bits/stdc++.h>using namespace std; inline bool cmp(int a,...

2019-04-06 23:24:04 203

原创 CodeBolcks使用小技巧

CodeBlocks 快速注释多行Ctrl + Shift + C快速取消注释Ctrl + Shift + X

2019-04-06 19:07:01 441

转载 蒜厂年会(环中最大连续和)

#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(void){ int n; cin >> n; vector <int > a(n+1); ll sum = 0; for(int i = 1 ; i <= n; i++)...

2019-03-22 21:37:11 261

原创 散列hash

#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(void){ cin.tie(0); int n; cin >> n; vector <ll> hs(n); map <ll, int> mp; for(in...

2019-03-21 15:01:51 185 1

原创 素数筛

const int maxn = (int)1e6+5;bool prime[maxn];void init(){ memset(prime,true,sizeof(prime)); prime[0] = prime[1] = 0; for(int i=2;i<maxn;i++) if(prime[i]){ if(i*i>maxn) conti...

2019-03-20 20:30:06 123

原创 蓝桥训练赛

#include<bits/stdc++.h>using namespace std;typedef long long ll;int main(void){ cin.tie(0); int n; cin >> n; vector <int> a(n),b(n),c(n); for(int i =0; i<n...

2019-03-19 21:43:13 169

原创 CodeForces ——1079C. Playing Piano(记忆化搜索 / DP )

CodeForces ——1079C. Playing PianoDFS版本:记忆化在DFS过程中出现过的,因为只要出现回溯,证明该深度下,所有方案都是无效解。 存一下这些无效的方案直接跳过~~/** @Author: Achan* @Date: 2018-11-20 19:29:26* @Last Modified by: Achan* @Last Modified tim...

2018-11-20 22:07:14 487

原创 CodeForces——1077 D. Cutting Out(二分答案)

题目链接解题思路:直接从众多“个数”中挑选满足答案的可能有很多。。。题目的限制条件是“find such array t that you can cut out the copy of t from s maximum number of times.” 所以要先二分找一个最大的amount,有了这个amount再去找k个满足的“个数”就可以啦/** @Author: Achan* ...

2018-11-17 17:46:15 956

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除