现在位置: 首页 > Jlbdvrxf发表的所有文章
  • 04月
  • 06日
综合 ⁄ 共 2285字 评论关闭
大意:给定经度、纬度,求两点之间的距离。 思路:将点的经度、纬度转换为三维坐标,然后求得A-B弧所对弦长,求得圆心角,乘以半径就是弧长了。 其中,North, East的经纬度我规定>0,South, West < 0。 这一题的精度要求非常BT,我是去网上下测试数据,然后暴力对拍才知道哪错了的,实际上是精确到小数点后3位。 附上我错的二组测试数据。 题外话:与昊哥抽题看谁A得快,结果尼玛比我快10s,彻底无语了。。 #include <iostream> #include <cstdlib> #include <cstdio> #include <string> #inclu......
阅读全文
  • 03月
  • 17日
综合 ⁄ 共 824字 评论关闭
  实用的 vs08 快捷键     Edit.ScrollLineDown CTRL + DOWN ARROW Scrolls text down one line. Available in text editors only. Edit.ScrollLineUp CTRL + UP ARROW Scrolls text up one line. Available in text editors only. Edit.ViewBottom CTRL + PAGE DOWN Moves to the bottom of the current document. Edit.ViewTop CTRL + PAGE UP Moves to the top of the current window. Edit.WordNext CTRL + RIGHT ARROW Moves the insertion point to the r......
阅读全文
  • 03月
  • 09日
编程语言 ⁄ 共 1540字 评论关闭
在WM下用户可以经常转屏,但是这个也能通过代码实现,下面是一个经过测试的代码。 int ChangeDisplaySettings( ) {     DEVMODE DevMode;     int RotationAngles = 0;     int CurrentAngle = 0;     int NewAngle = 0;      //Check for rotation support by getting the rotation angles supported.     memset( &DevMode, 0, sizeof( DevMode ) );     DevMode.dmSize = sizeof( DevMode );     DevMode.dmFields = DM_DISPLAYQUERYORIENTATION;      if( DISP_CHANGE_SUCCESSFUL == ChangeDisplaySettingsEx( NULL, &......
阅读全文
  • 10月
  • 05日
数据库 ⁄ 共 201字 评论关闭
都是在MySql Query Browser中执行。 一、获取当前时间       SELECT CURDATE();       SELECT NOW(); 二、获取相对于1970年1月1日8点的秒数:       SELECT TIMESTAMPDIFF(SECOND, '1970-1-1 8:0:0', NOW());       SELECT TIMESTAMPDIFF(SECOND, '1970-1-1 8:0:0', CURDATE());
阅读全文
  • 05月
  • 14日
综合 ⁄ 共 225字 评论关闭
下午写JS代码,HTML文件里的JS程序都放进一个js文件里去了。 没放之前,程序跑的好好的,但已放进去之后,却怎么也跑不起来。 我十分郁闷,就一直在检查错误。 但整整一个下午都没有检查出来。 心里那个急呀!   直到刚刚,公司的人都走了,我还在查看,就那么短短的几十行代码。 可巧,终于让我发现了问题所在! 原来那个js文件里的一个函数名后面少了一对括号(),结果导致整个Js文件都无法跑起来!   哎,想起来真可笑! 一对小括号害了我一个下午!   以后还是要用心啊!!!
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 3140字 评论关闭
UVa OJ Root :: AOAPC I: Beginning Algorithm Contests (Rujia Liu) :: Volume 1. Elementary Problem Solving :: Sorting/Searching  Master-Mind Hints  MasterMind is a game for two players. One of them, Designer, selects a secret code. The other, Breaker, tries to break it. A code is no more than a row of colored dots. At the beginning of a game, the players agree upon the length N that a code must have and upon the colors that may occur in a code. In order to break the code, Breake......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 1481字 评论关闭
 Problem A.Ant on a Chessboard  One day, an ant called Alice came to an M*M chessboard. She wanted to go around all the grids. So she began to walk along the chessboard according to this way: (you can assume that her speed is one grid per second)   At the first second, Alice was standing at (1,1). Firstly she went up for a grid, then a grid to the right, a grid downward. After that, she went a grid to the right, then two grids upward, and then two grids to the left…in a word, the path was......
阅读全文
  • 04月
  • 23日
综合 ⁄ 共 739字 评论关闭
背景:dfs递归实现。 思路:对于每一个@都把和组成一个片区相连的所有@变成*,并计数一次。 #include<cstdio> #include<cstring> #include<iostream> using namespace std; char map[105][105]; int direction[8][2]={1,0,1,1,1,-1,0,1,0,-1,-1,0,-1,1,-1,-1}; void dfs(int i,int j){ map[i][j]='*'; for(int row=0;row < 8;row++){ if(map[i+direction[row][0]][j+direction[row][1]] == '@'){ dfs(i+direction[row][0],j+direction[row][1]); } } } int mai......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 758字 评论关闭
拓扑排序不用解释了。 下面的代码用的是DFS的思路来做,稍微修改也可以用作判断是否有环。 int c[N]; int topo[N],t; bool dfs(int u) { c[u]=-1; for(int v=0;v<n;v++) if ( graph[u][v]==1 ) { if ( c[v]==-1 ) return false; // circle else if ( c[v]==0 && !dfs(v) ) return false; } c[u]=1; topo[--t]=u; //sequence return true; } bool toposort() { t=n; memset(c,0,sizeof(c)); for(int u=0;u<n;u++) if ( c[u]==0 ) if ( dfs(u)== false ) return false; re......
阅读全文
  • 03月
  • 21日
综合 ⁄ 共 770字 评论关闭
 作者:Younger Liu, 本作品采用知识共享署名-非商业性使用-相同方式共享 3.0 未本地化版本许可协议进行许可。 几乎每一种版本控制系统都以某种形式支持分支。使用分支意味着你可以从开发主线上分离开来,然后在不影响主线的同时继续工作。在很多版本控制系统中,这是个昂贵的过程,常常需要创建一个源代码目录的完整副本,对大型项目来说会花费很长时间。 有人把Git 的分支模型称为“必杀技特性”,而正是因为它,将 Git 从版本控制系统家族里区分出来。Git 有何特别之处呢?Git 的分支可谓是难以置信的轻量级,它的新建操作......
阅读全文
  • 02月
  • 17日
综合 ⁄ 共 2594字 评论关闭
一、动态链接库简介 动态链接库英文为DLL,是Dynamic Link Library 的缩写形式,DLL是一个包含可由多个程序同时使用的代码和数据的库 ,DLL不是可执行文件。动态链接提供了一种方法,使进程可以调用不属于其可执行代码的函数。函数的可执行代码位于 一个 DLL 中,该 DLL 包含一个或多个已被编译、链接并与使用它们的进程分开存储的函数。DLL 还有助于共享数据和 资源。多个应用程序可同时访问内存中单个DLL 副本的内容。DLL 是一个包含可由多个程序同时使用的代码和数据的库。 dll优点和作用:     1、扩展了应用程序的特性; ......
阅读全文
  • 02月
  • 07日
综合 ⁄ 共 2172字 评论关闭
<html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Untitled Document</title> <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js> </script> </head> <body> <div> 添加门店&nbsp; <input type="text" name="warehouseno" maxlength="20" value="" on......
阅读全文