- 博客(38)
- 资源 (4)
- 收藏
- 关注
原创 OpenCV笔记:图像简记
1.图像读写功能:加载,显示,保存接口定义:Mat imread( const string& filename, int flags=1 );void imshow(const string& winname, InputArray mat);bool imwrite( const string& filename, InputArray img, ...
2018-05-25 09:35:32
193
原创 OpenCV笔记:滤波器
1.方框滤波函数名:boxFilter接口定义:void boxFilter( InputArray src, OutputArray dst, int ddepth, Size ksize, Point anchor=Point(-1,-1), bool normalize=true, ...
2018-05-24 18:47:30
207
原创 线段树
HDU - 1166 敌兵布阵题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166点更新,区间查询区间和,直接代模板代码如下:#include <stdio.h>#include <math.h>#define MAXN 50005int a[MAXN];int segment_tre...
2018-03-28 11:33:56
194
原创 Bayer图像转RGB
Bayer图像不做赘述1.Bayer(GRBG)图像转RGB处理方法:对于某个像素点,存在的分量值不变化,缺少的两个分量值使用Correlation-Adjusted算法QImage CorrelationAdjusted(QImage srcImg, int type){ int imgW = srcImg.width(); int imgH = srcImg.
2017-11-17 18:24:35
6172
1
原创 OSG学习笔记2:地形构建和模型加载
一、准备数据文件:地形数据map.data,模型数据car.ms3d.float *terrainHeights;float intervalX = 20;float intervalY = 20;float terrainGridLength; //y方向float terrainGridWidth; //x方向double COLOR[8][3] = { { 0, 0,
2017-09-27 17:36:05
2771
原创 OSG学习笔记1:OSG环境编译
系统:Win10_x64环境:Vs2013+Qt 5.7.0一、准备:文件1:CMake(cmake-3.9.1-win64-x64.zip);文件2:OpenSceneGraph(OpenSceneGraph-3.4.0.zip);文件3:Data(OpenSceneGraph-Data-3.4.0.zip);文件4:3rdParty(3rdParty_VS2013.5_
2017-09-22 13:37:56
967
原创 TOJ : 1794. The Bottom of a Graph
题目:http://acm.tju.edu.cn/toj/showp1794.html#include #include #include #include using namespace std;#define maxn 5005int scc[maxn], low[maxn], num[maxn], st[maxn], is[maxn];int nsc, mn, sz, n,
2016-05-11 20:17:10
284
原创 TOJ : 2844.Emergency Mission
2844:http://acm.tju.edu.cn/toj/showp2844.htmlint n, m, k, ans;vector v;void solve() {v.clear();ans = 0;inc(i, 0, n+m) {int a, b, c;cii(a, b); cit(c);ans += (c+k-1)/k*b;if(i >=
2016-04-20 23:25:24
296
原创 学习笔记
/* 相关公式S(x) = M[j]*(x[j+1]-x)^3/(6*h[j])+M[j+1]*(x-x[j])^3/(6*h[j])+ (y[j]-M[j]*h[j]^2/6)*(x[j+1]-x)/h[j]+(y[j+1]-M[j+1]*h[j]^2/6)*(x-x[j])/h[j];ps:h[j] = x[j+1]-x[j];ps:u[j] = h[j-1]/(h[j-1]+h[
2016-04-20 14:45:40
201
原创 TOJ : 4014. Warm up 2
题目链接:http://acm.tju.edu.cn/toj/showp4014.htmlint n, m, flg = 0, ans;int h[105][105], v[105][105];vint g[maxn];bool vis[maxn];void add(int u, int v) { g[u].puck(v); g[v].puck(u);}void dfs(int
2016-03-27 17:58:34
245
原创 Problem K. Kingdom Division 2
Problem K. Kingdom Division 2Input le: kingdom.inOutput le: kingdom.outTime limit: 2 secondsMemory limit: 256 megabytesOnce upon a time there was a kingdom ruled by a wise king. After fort
2015-08-03 09:41:24
458
原创 URAL 2026 C - Dean and Schedule
/*PROBLEM C : DEAN AND SCHEDULE "UNSOLVED" */#include "cstdio"#include "cstring"#include "cctype"#include "algorithm"using namespace std;#define Inc(i, a, b) for(int i = a; i < b; i++)#define
2015-08-02 10:56:08
408
原创 PROBLEM_B: URAL 2025 B - Line Fighting
/*PROBLEM B: LINE FIGHTING "SOLVED" */#include "cstdio"#include "cstring"#include "cctype"#include "algorithm"using namespace std;#define Inc(i, a, b) for(int i = a; i < b; i++)#define Dec(i, a
2015-08-02 10:53:49
410
原创 PROBLEM_A: URAL 2024 Adventure Time
/*PROBLEM A : "UNSOLVED" *//*TIME : ________________*/#include "cstdio"#include "cstring"#include "cctype"#include "algorithm"#include "cmath"#include "vector"using namespace std;#define Inc(
2015-08-02 08:05:15
598
原创 PROBLEM_J: Gym 100345J - Zen Garden
/*PROBLEM C : DEAN AND SCHEDULE "SOLVED" *//*TIME : ________________________________*/#include "cstdio"#include "cstring"#include "cctype"#include "algorithm"#include "cmath"#include "vector"u
2015-08-02 07:55:43
361
转载 和差值最小的数组划分问题
Problem 1:Balanced PartitionYou have a set, A = {a1,···, an}, of n integers. Partition these integers into two subsets such that you minimize |S1 − S2|, where S1 and S2 denote the sums of the eleme
2015-05-19 20:12:59
872
转载 二进制到十六进制转换程序
___________________________________________________________________________CODE SEGMENTMAIN PROC FAR ASSUME CS: CODESTART: ; SET UP STACK FOR RET PUSH DS ; save old data segment
2015-05-17 13:43:46
584
原创 学习资料收集
#include #define maxn 10001using namespace std;int sum[maxn << 2];int order, x, y;void build(int t, int l, int r) { int m = (l + r) >> 1; if (l == r) scanf("%d", sum + t); else {
2014-07-11 09:42:09
288
原创 TOJ : 4065. Query on an array
题目描述 :Time Limit: 8.0 Seconds Memory Limit: 65536KTotal Runs: 17 Accepted Runs: 6Give you n positive integer, and the key number is 223092870.There will be q queries, in each query, yo
2014-06-15 21:51:11
407
原创 TOJ : 1330. Mine Sweeper
题目 : http://acm.tju.edu.cn/toj/showp1330.html之前做过yidao
2014-06-15 21:36:40
454
原创 TOJ:1746. How many sums
http://acm.tju.edu.cn/toj/showp1746.html开始的时候没有想到会是大数,用了unsigned long long 然后就发现,数据范围不够,输出有负值#include #include #include #define Base 1e8#define MAXN 601using namespace std;int dp[MAX
2014-03-16 09:48:55
694
原创 TOJ:2407. 4 Values whose Sum is 0
http://acm.tju.edu.cn/toj/showp2407.html二分,先将前面两个数组的和求出排序,然后是后面两个求和逆序;#include #include using namespace std;typedef long long ll;int n, arr[4010][4];int b[4010 * 4010], c[4010 * 4010];in
2014-03-15 15:07:18
769
原创 TOJ:Prairie dogs
2192. Prairie dogs I#include #include #include #define MAXN 10using namespace std;char s[MAXN][MAXN];bool v[MAXN][MAXN];int m, n, room, cirs, area;void search(int x, int y){ if (x >= 0
2014-03-15 14:51:21
576
原创 TOJ:3254. Rock-Paper-Scissors
#include #include #include #include #include #include #include #define MAXN 55using namespace std;int Judge(char a, char b){ if(a =='R') { if(b =='R') return 1; else if(b =='S') return
2014-03-15 14:44:09
398
原创 TOJ:3225. Clock
通过公式会发现,时针与分针的角度分数时分母只有2.#include #include #include #include #include using namespace std;char s[10];int main(){ int cas, hour, minute, tt; cin >> cas; while (cas--) { scanf( "%d:%d"
2014-03-15 14:42:15
969
原创 TOJ:2870. The K-th City
#include #include #include #include #define MAXN 205#define MAX 500000using namespace std;int map[MAXN][MAXN];int N, M, K, a, b, dis;struct Road{ int city; int len;} road[MAXN];bool c
2014-03-15 14:36:34
565
原创 TOJ:3210. Moon Mooing
总是“死不悔改”,经常因为type的缘故,WA,一开始是用int,转的long long,果断错#include #include #include #include #include #include #define MAXN 4000010#define eps 1e-7using namespace std;typedef long long ll;ll c, N,
2014-03-14 21:50:13
631
原创 TOJ:2971. Rotating Numbers
满满的都是怨念!本来是用的string做的0.4K左右,结果总是Runtime Error SIGSEGV不明觉厉#include #include #include using namespace std;typedef long long ll;bool ok(ll x){ ll t = x; while (t) { if (t % 10 == 0) return
2014-03-14 21:46:46
399
原创 TOJ-2234. A+B In the Future
//不知道为什么,我的代码怎么这么多#include #include #include using namespace std;char a[25], b[25], s[25];int aa[25], bb[25], num[25];int la, lb, flag = -1;int getnum(char c){ if (c >= '0' && c <= '9') r
2014-02-14 15:23:45
445
原创 TOJ-3499. Network
//基础太差,做题就像脑筋急转弯一样,想到了才能AC#include #include #define M 10005using namespace std;int map[M], num[M];int main(){ int n, m, k, t1, t2, cnt; while (scanf("%d%d%d", &n, &m, &k) != EOF) { cnt =
2014-02-14 14:45:59
603
原创 TOJ-1409 - Equations
//感觉做这种题,错了便只能无限WA,不知道错在哪里#include #include #include #include #include #include #include #include using namespace std;char s1[800], s2[800];int num[2][5]; int gcd(int a, int b){ if (a
2014-02-14 14:40:09
474
原创 TOJ-1959. Oil Deposits
//和以前做过的一道题有点像,想占座一样,找到能坐的就贴个标签#include #include using namespace std;char s[110][110];int m, n, cnt; void search(int x, int y){ if (x >= 0 && y >= 0 && x < m && y < n && s[x][y] == '@') {
2014-02-14 14:30:08
378
原创 TOJ-3135- Giant Screen
#include #include #include using namespace std;int rh0, rv0, sh0, sv0; int main(){ int rh, rv, sh, sv, n, price, ans, tmp, l, m; scanf("%d%d%d%d", &rh0, &rv0, &sh0, &sv0); scanf("%d", &n);
2014-02-14 14:24:58
459
原创 TOJ-2191-Golden Flower
//简单题:竟然和自己平常玩的扎金花规则不同,没看仔细,结果亏了几次WA#include #include #include #include #include #include using namespace std;char s[6][5];int flag1, flag2, ans;struct card{ char item; int value;} a[5]
2014-02-14 14:22:35
434
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人