软件工具

brew 会员管理系统 iopaint yaml Rider Auto GPT Airtest Stable Diffusion 飞书 Programmer AI Copilot X softwares for windows softwares for website softwares for mac softwares for ios softwares for android Filezilla Cocoapods wireshark pyCharm Microsoft Edge vscode 短信关键字 Ubuntu 阿里云 视频下载 百度贴吧 百度云管家 爬虫 模拟器与手机 晨风QQ机器人 文件下载 按键精灵 抖音 微信 京东 云手机 yarn virtualbox vim truffle tor browser tomcat telegram sqlite3 spine shell shadowsocks scrapy scons rust repo pyenv preact pp助手 phpstorm pgAdmin pear pecl parity nvm npm nginx markdown magnet loadrunner laravel jekyll itunes iPhone heroku govendor google chrome gitlab github git eclipse docker cygwin composer cocos studio cmake carthage batch command apktool apachectl apache adobe photoshop adb aapt ZeroNet Xcode Windows WinHex WebStorm Visual Studio VMware TortoiseSVN ThinkSNS TexturePacker TeamViewer Subversion Sublime Text SourceTree SecureCRT SVN RTX QQ PostgreSQL OpenIM OpenGL Shader Builder OD Notepadplusplus Navicat for MySQL Mono MongoDB MinIO MinGW Microsoft Visual Studio Mac OS X Linux Laradock Kafka Jenkins Genymotion FontCreator ETCD CocosBuilder CentOS Bootstrap Beyond Compare Angular2 Android Studio 3ds Max 360 Visual Studio2010快捷键及设置 ChatGPT HRESULT 0x80004005 E_FAIL 美团开店宝 搜狗输入法 ohmyzsh meson golang mobile library gitea fvm _ WireGuard V2Ray RocketChat Fork Clash _ ChatGPT局限性研究

编程开发

Unity3D 开源项目 Unity3D超链接 Unity3D spine Unity3D shader lua热重载 Bloom chrome extension Particle System Sprite Renderer Overdraw 字体描边 Unity3D热门插件 TronLink Bmfont TextMeshPro Behaviour Tree ThinkPHP ajax Hexagonal Grids python基础知识 python argparse和optparse eth eth layer2 ios点滴积累 exr UGUI优化 lua定义不允许定义变量的class 7za源码 打印堆栈 C C++点滴积累 android基础知识 xLua java基础知识 Unity DOTS Unity3D大规模角色渲染 Flutter metamask andriod源码编译 React Native git as a database android逆向 越狱 ios逆向开发 ipfs链编程 cocos2d-x3.x文字模糊 lua创建class v3quick 智能合约升级方案 gitlab服务器迁移 go调用C++ 区块链编程 cocos2dx lua项目转html5项目 SSL aar转jar unity热更方案 unity升级 源码 反编译获取任何微信小程序源码 基础知识 cocos2dx ipv6支持 ClippingNode sprite的触摸事件 redis 加密算法 protobuf JAR creation failed. See details for additional information cocos2dx内存管理 SDK服务器 vpn服务器搭建 获取焦点 某些android系统下自动优化代码 异常处理 内存泄露分析 代码混淆 生成唯一id oauth2 IIS和tomcat共用80端口 enum MultiValueMap 易语言基础知识 MySQL eclipse的devices上不显示调试程序包名 搭建服务器下载文件 switch case的效率问题 获取版本号和版本名 cocos2d-js js语法 meta-data的获取 cocos2d-js安装 Paper2D rapidjson unreal源码赏析 NEON reload lua scripts go发邮件 smali语法 Spring lua枚举实现 PainTown编译 STL各容器操作 ios性能测试 UI Engines Game Engines Comparison CCActionInterval cocos bugs variadic templates singleton class POSIX g3log 不能在非主线程中使用OpenGL ES的UI函数 Menu get class name based on class #type 宏的含义 类模板的部分特化 各编译器对C++的支持度 Open Source Log Systems Comparison 百度语音识别SDK 锚点anchorPoint Unity3D插件 View Frustum Culling Matrix Layouts, DirectX and OpenGL DirectX基础知识 详解Cocos2d-X中宏CC_DLL android 国际化语言 locale缩写 android error solutions unity调用webservice Unity3D调用C++的dll Unity Error Solutions 非组合BCD码VS组合BCD码 磁盘的磁道(track) use static Variables in static library ndk编译出错-Werror UNICODE字符集之 UTF-8、UTF-16 SpringBoard 无法启动应用程序 -4 Setting up a Code Repository on Google 透视投影变换 编译ogre_src_v1-7-4 windows 编译 ogre 1.9.0 ios undo 绘制次序 纹理寻址模式设置不当 显存带宽 bandwidth 分析碰撞检测库Opcode 《Fighting, Antiquity》遇见的各种问题 send TEXCOORD from DirectX9.0 to HLSL mul(inPos, matViewProjection) and mul(matViewProjection, inPos) A* Pathfinding X File Hierarchy Loading VS高亮HLSL关键字 Umbra 3:次世代的遮挡裁剪 Steering Behaviors For Autonomous Charac Rendering the Great Outdoors/Fast Occlusion Culling for Outdoor Environments Programming OpenGL ES with ios Perlin Noise OpenGL中freeglut的安装 OpenGL OpenGL ES hardware support OgreSDK_vc10_v1-7-4第一次编译程序运行crash Missing texture object named 'Texture0' in pixel shader 'Pixel Shader' in pass 'Pass 1' Loading .x files the easy way Load .obj model Get Texture Coordinates from DirectX in Vertex Shader Fx Composer Effect Framework DirectX 9.0中BeginPass和EndPass放置问题 DirectInput Coding in RenderMonkey Bézier curve Bullet Advanced Collision Detection Techniques 3D游戏引擎中的室外大场景渲染技术研究与实现 3D实时渲染中的BSP树和多边形剔除 fxc的使用及调试技巧 编译注意点 点滴积累 windows搭建android和cocos2dx环境 sprite::create("*.png")崩溃 Unknown EABI object attribute 44 CCUserDefault使用注意点 APP_STL := gnustl_static APP_CPPFLAGS := -frtti APP_CPPFLAGS += -fexceptions #pragma once与 #ifndef的区别 #ifdef _DEBUG 重载识别多重继承 返回值尽量返回const值 缺省实参编译时刻决定 编译器优化 纯虚析构函数必须定义 类继承中调用函数 类模板运用之实现委托类 类模板运用 类模板的友元 类成员函数声明为另外一个类的友元 析构函数出域就析构 指针的运用 成员函数模板和自动转换的选择 成员函数指针的运用 成员函数和非成员函数重载问题 在if里面请写入语句 使得打印出 hello world。 typedef作用 —— 定义机器无关的类型 static_cast注意点 static DWORD成员变量定义 operator<<重载 multimap容器不能用greater_equal case语句内定义变量 boost使用 本地函数定义是非法的 __attribute__ Type Conversion Override controls override and final OSI七层网络模型与TCP:IP四层网络模型 C:C++里面变量名的最大长度是多少? C++模板初始化 .h和.hpp区别 游戏崩溃查找dump crash堆栈信息 未签名的apk无法安装到手机上 延迟执行任务 平台接入 安装apk到手机中,elipse并非完全拷贝整个apk 多线程用多少个线程最合适 使用NDK编译so动态库 中国移动第三方接入 onNewIntent eclipse调试android程序 eclipse下android环境搭建 apk重启程序代码 apk 签名 ant 自动编译 android开发中遇到sqlite3 not found android制作九宫格图 android.database.CursorIndexOutOfBoundsException android 指定类 android ndk 开发之Application.mk android assets常见问题 android 4.0 NetworkOnMainThreadException ZXing竖屏解决(完美版) XP环境下java环境变量配置 Unable to execute dex/Multiple dex files define The nested fileset element is deprectated, use a nested path instead Re-installation failed due to different application signatures. ROM修改 NDK工具之 addr2line NDK和Eclipse的集成 MySQL相关 ListView无法在onCreate的时候getChildCount() JNI运用 Database Design/UUID vs Integer Auto-Increment Android点滴积累 Android查看内存 Android.mk文件详解 Android string Android NDK 官方下载地址 Adding ActionBar Items From Within Your Fragments Activity 生命周期 php环境搭建 Objective-C的方法原型和重载 c#反射机制 .NET入门 mac 下搭建lua环境 objective c点滴积累 OGRE点滴积累 Unity3D点滴积累 Unity3D NGUI lua基础知识 typescript基础知识 solidity基础知识 php基础知识 nodejs基础知识 kotlin基础知识 javascript基础知识 html基础知识 C#基础知识 css基础知识 golang基础知识 破解技术 assembly点滴积累 _ _ Unity3D优化 Unity3D 模型 Unity3D Editor HybridCLR _ _ _ meteor kodi gopeed generative_agents _ VLC Media Player MPV MLN ChatDev _ _ Copay _ _ gradle _ _ _

errors

MacOS 升级BigSur后无法使用git svn Unit php-fpm.service could not be found Uncaught ReferenceError process is not defined Uncaught ReferenceError Buffer is not defined thread.cc Throwing new exception length=433 index=1340 ArrayIndexOutOfBoundsException Provisioning profile doesn't include signing certificate indenting spaces must be used in groups of 2 Nokogiri install failures eth合约报错 xcode __nwlog_err_simulate_crash_libsystem pod生成工程后编译lib The SSL certificate is invalid php编译错误 not a valid ELF invalid resource directory name appcompat_v7 res crunch Invalid Code Signing Entitlements 该文件没有与之关联的程序来执行该操作 dyld Library not loaded rpathlibfmodL a2003- cant connect to MYSQL server on localhost android.view.WindowManager BadTokenException is your activity running android.view.WindowLeaked no suitable device found no device found for connection git push Server error goroutine 1 efrror RPC failed result=18 HTTP code 200 This version of the rendering library is more recent than your err 1005 Can't create table error 150 could not initialize proxy no Session could not execute query nested exception ArtifactDescriptorException Failed to read artifact descriptor is not a valid JNI reference INSTALL_FAILED_DEXOPT brut.androlib.AndrolibException ARSCDecoder.decode error 未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序 无法解析 __imp__printf 无法定位程序输入点sdl_strlcpy LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 lwebsockets is not an object file Failed to git submodule update --recursive --init libpng error CgBI unhandled critical chunk symbol not found for architecture armv7 provider: 共享内存提供程序, error: 0 管道的另一端上无任何进程 and sa登陆失败 错误:18456 file is universal 3 slices but does not contain an armv7s slice error 126 无法解析的外部符号:error LNK2019 无法解析的外部符号 RegQueryValueEx、RegCloseKey、RegOpenKeyEx、RegSetValueEx... 无法解析外部符号 __imp__CoUninitialize@0、_TID_D3DRMFrameTransformMatrix 无法解析_c_dfDIMouse、_c_dfDIKeyboard、_DirectInput8Create@20、_c_dfDIJoystick2 无法解析 __imp__ExtractIconW@12、 __imp__ExtractIconW@12 无法打开文件"dxerr9.lib" 无法打开文件 d3dx9.lib 无法启动应用程序 1>------ 已启动生成: 项目: Init Direct3D, 配置: D 1>------ 已启动生成/项目/Font, 配置/Debug Win3 安装DirectXSDK时提示Error Code s1023 不允许使用不完整的类型 warning:DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800 warning MSB8004: Output 目录未以斜杠结尾。此生成实例将添 warning C4996: 'strcpy': This function or variable may be unsafe. warning C4355: “this”: 用于基成员初始值设定项列表 warning C4290: 忽略 C++ 异常规范,但指示函数不是 __declspec(nothrow) warning C4003: “max”宏的实参不足 vs2010出现link2005 static_cast(pStr) release版本下静态链接库无法解析外部符号 pragma warning(disable:4996) gult32.dll gorm查询sqlite3报错 general error c101008a_ Failed to save the updated manifest to the ft2build.h file not found with include, use “quotes” instead error X3025 error LNK2019 __imp__InitCommonControls@0 error LNK2001 无法解析的外部符号_mainCRTStartup error C2443: 操作数大小冲突 crosses initialization cmath(19): error C2061: 语法错误: 标识符“acosf” ava.io.IOException Cannot run program jarsigner.exe __imp__InitCommonControlsEx@4 __imp__EndDialog __gmsl:512:*** non-numeric second argument to `wordlist' function: ''. _ITERATOR_DEBUG_LEVEL”的不匹配项问题 _ITERATOR_DEBUG_LEVEL XCode: duplicate symbol error when using global variable - Stack Overflow Application does not specify an API level requirement! VS2010 fatal error C1902: 程序数据库管理器不匹配;请检查安装 S1023 error on installing DirectX SDK LNK4006 symbol already defined in object; second definition ignored LNK2001 : unresolved externals IDirectSound8无法使用 Failure Reason Message from debugger Terminated due to memory issue DirectX Preview window: WARNING: Pixel shader 'Pixel Shader' cannot be created on hardware rendering COMMON ERROR - python 无法解析的外部符号 __imp__ExtractIconW@12 _

左右互搏

Git Repositories Unity3D GUI 通讯协议 nodejs开源项目 Unity3D逆向工具 ps软件 NFT游戏 开源音乐项目 视频编辑软件 IM React Native Chat Library Messaging server backend go服务框架 浏览器 本地硬盘作服务器 自动按键 接码平台 数据清洗 go library for git go library for android ios React Native Apps Flutter Apps 加密算法 golang logging library python数据库框架 持续集成工具/Continuous integration(CI) 压缩存储 github guis git guis Gateway Server 图床工具 爬虫工具 lua远程调试器 去中心化数据库 去中心化云存储 noserver softwares php数据库框架 无服务器模式 服务器平台 宝塔 域名租用 php框架 文档管理工具 共识机制 库管理工具 区块链平台 量化交易 数字货币资讯软件 扩容方案 Web服务器 包管理工具 Web前端框架 交易所 Wallets DAPP Root工具 通用应用层协议 数据库 开发框架 数字货币 h5引擎 开源云盘 日志统计工具 博彩 团队协作工具 外包平台 ftp工具 remote control softwares log4j与slf4j 翻墙工具VPN scripting language low level graphics library Cygwin MinGW Build Tools 格斗引擎 shader tools UML Books 版本控制软件 开源语音识别库 Physics Engines 远程控制软件 跨平台开发框架 自动测试工具 思维导图 工作流CI CD工具 局域网传输 telegram server go library for server git in go app热更 _ PM常用工具 Optical Character Recognition(OCR) Open Source Video Player Open Source Magnet Websites

数据结构与算法

背包问题 文件读取效率研究 随机选项和宽字符输出 过桥最短时间 输入一个正整数 设计一个程序 表达式求值 罗马数字与整数相互转换 编程求两个矩形的相交矩形 给定一个字串X 砝码称重 母函数问题 模拟实现乘法运算 某人有三个儿子 有一个长度为N的数字串 有5座不同颜色的房子 最长子串 最大子矩阵之和 在字符串S中寻找最 写一个程序 写一个函数 二维数组排序 一个线段随机分成三段能够构成三角形的概率 一个int数组,里面数据无任何限制,要求求出所有这样的数a[i], 其左边的数都小于等于它,右边的数都大于等于它。 能否只用一个额外数组和少量其它空间实现。 How many 0 appears Fabonacci数列定义为 Do remember 骆驼吃香蕉问题 错排原理 逻辑推理宴会握手 输入一个整数n 设计一个系统处理词语搭配问题 设计一个不能被继承的 设七位数是 编写代码把16进制表示的串转换为3进制表示的串 每个飞机只有一个油箱 概率问题 桌面上有24张光滑面扑克牌 根据上排给出十个数 有一个长度为998的数组 有一个复杂链表 有81个选手 有5个人比赛 有2.5亿个整数存放在一个文件中 有10个文件 无限容量的体育馆 数列L中有n个整数 把一个钝角三角形 循环队列 外星人打算将地球用来种蘑菇 在一天的24小时之中 判断另一字符串的所有字母是否在母串中都有 判断一个数是4的整数次幂 全部有火柴根组成 你有一个横6竖6的方格 九宫图解法 两个数组 不能使用库函数 下一个数是什么 一道小学数学题可以证明你是否可以玩股票 一个猜测游戏中 一个文件 一个教授逻辑学的教授 \[约瑟夫环\]n个数字 Longest Common Subsequence Fibonacci 12个高矮不同的人 100层楼 1000瓶药水 0-1背包 随机洗牌:哪种算法正确 求连续自然数平方和的公式 各种算法复杂度比较 教你如何迅速秒杀掉:99%的海量数据处理面试题 _ _

标签

software 152

android 61

andriod源码编译 自制脱壳rom aar转jar JAR creation failed. See details for additional information 获取焦点 某些android系统下自动优化代码 异常处理 内存泄露分析 代码混淆 enum MultiValueMap eclipse的devices上不显示调试程序包名 获取版本号和版本名 js语法 meta-data的获取 smali语法 mobile devices information android 国际化语言 locale缩写 android error solutions 游戏崩溃查找dump crash堆栈信息 未签名的apk无法安装到手机上 延迟执行任务 平台接入 安装apk到手机中,elipse并非完全拷贝整个apk 多线程用多少个线程最合适 使用NDK编译so动态库 中国移动第三方接入 onNewIntent eclipse调试android程序 eclipse下android环境搭建 apk重启程序代码 apk 签名 ant 自动编译 android开发中遇到sqlite3 not found android制作九宫格图 android.database.CursorIndexOutOfBoundsException android 指定类 android ndk 开发之Application.mk android assets常见问题 android 4.0 NetworkOnMainThreadException ZXing竖屏解决(完美版) XP环境下java环境变量配置 Unable to execute dex/Multiple dex files define The nested fileset element is deprectated, use a nested path instead Re-installation failed due to different application signatures. ROM修改 NDK工具之 addr2line NDK和Eclipse的集成 MySQL相关 ListView无法在onCreate的时候getChildCount() JNI运用 Database Design/UUID vs Integer Auto-Increment Android点滴积累 Android查看内存 Android.mk文件详解 Android string Android NDK 官方下载地址 Adding ActionBar Items From Within Your Fragments Activity 生命周期 gradle _
Unit php-fpm.service could not be found Uncaught ReferenceError process is not defined Uncaught ReferenceError Buffer is not defined thread.cc Throwing new exception length=433 index=1340 ArrayIndexOutOfBoundsException Provisioning profile doesn't include signing certificate indenting spaces must be used in groups of 2 Nokogiri install failures eth合约报错 xcode __nwlog_err_simulate_crash_libsystem pod生成工程后编译lib The SSL certificate is invalid php编译错误 not a valid ELF invalid resource directory name appcompat_v7 res crunch Invalid Code Signing Entitlements 该文件没有与之关联的程序来执行该操作 dyld Library not loaded rpathlibfmodL a2003- cant connect to MYSQL server on localhost android.view.WindowManager BadTokenException is your activity running android.view.WindowLeaked no suitable device found no device found for connection git push Server error goroutine 1 efrror RPC failed result=18 HTTP code 200 This version of the rendering library is more recent than your err 1005 Can't create table error 150 could not initialize proxy no Session could not execute query nested exception ArtifactDescriptorException Failed to read artifact descriptor is not a valid JNI reference INSTALL_FAILED_DEXOPT brut.androlib.AndrolibException ARSCDecoder.decode error 未在本地计算机上注册“Microsoft.Jet.OLEDB.4.0”提供程序 无法解析 __imp__printf 无法定位程序输入点sdl_strlcpy LNK1123: 转换到 COFF 期间失败: 文件无效或损坏 lwebsockets is not an object file Failed to git submodule update --recursive --init libpng error CgBI unhandled critical chunk symbol not found for architecture armv7 provider: 共享内存提供程序, error: 0 管道的另一端上无任何进程 and sa登陆失败 错误:18456 file is universal 3 slices but does not contain an armv7s slice HRESULT 0x80004005 E_FAIL error 126 无法解析的外部符号:error LNK2019 无法解析的外部符号 RegQueryValueEx、RegCloseKey、RegOpenKeyEx、RegSetValueEx... 无法解析外部符号 __imp__CoUninitialize@0、_TID_D3DRMFrameTransformMatrix 无法解析_c_dfDIMouse、_c_dfDIKeyboard、_DirectInput8Create@20、_c_dfDIJoystick2 无法解析 __imp__ExtractIconW@12、 __imp__ExtractIconW@12 无法打开文件"dxerr9.lib" 无法打开文件 d3dx9.lib 无法启动应用程序 1>------ 已启动生成: 项目: Init Direct3D, 配置: D 1>------ 已启动生成/项目/Font, 配置/Debug Win3 安装DirectXSDK时提示Error Code s1023 不允许使用不完整的类型 warning:DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800 warning MSB8004: Output 目录未以斜杠结尾。此生成实例将添 warning C4996: 'strcpy': This function or variable may be unsafe. warning C4355: “this”: 用于基成员初始值设定项列表 warning C4290: 忽略 C++ 异常规范,但指示函数不是 __declspec(nothrow) warning C4003: “max”宏的实参不足 vs2010出现link2005 static_cast(pStr) release版本下静态链接库无法解析外部符号 pragma warning(disable:4996) gult32.dll gorm查询sqlite3报错 general error c101008a_ Failed to save the updated manifest to the ft2build.h file not found with include, use “quotes” instead error X3025 error LNK2019 __imp__InitCommonControls@0 error LNK2001 无法解析的外部符号_mainCRTStartup error C2443: 操作数大小冲突 crosses initialization cmath(19): error C2061: 语法错误: 标识符“acosf” ava.io.IOException Cannot run program jarsigner.exe __imp__InitCommonControlsEx@4 __imp__EndDialog __gmsl:512:*** non-numeric second argument to `wordlist' function: ''. _ITERATOR_DEBUG_LEVEL”的不匹配项问题 _ITERATOR_DEBUG_LEVEL XCode: duplicate symbol error when using global variable - Stack Overflow Application does not specify an API level requirement! VS2010 fatal error C1902: 程序数据库管理器不匹配;请检查安装 S1023 error on installing DirectX SDK LNK4006 symbol already defined in object; second definition ignored LNK2001 : unresolved externals IDirectSound8无法使用 Failure Reason Message from debugger Terminated due to memory issue DirectX Preview window: WARNING: Pixel shader 'Pixel Shader' cannot be created on hardware rendering COMMON ERROR - python 无法解析的外部符号 __imp__ExtractIconW@12 _
Behaviour Tree Hexagonal Grids 背包问题 域名 ipa重新打包 苹果过审 cocos2dx ipv6支持 redis 加密算法 protobuf 生成唯一id 文件读取效率研究 随机选项和宽字符输出 过桥最短时间 输入一个正整数 设计一个程序 表达式求值 罗马数字与整数相互转换 编程求两个矩形的相交矩形 给定一个字串X 砝码称重 母函数问题 模拟实现乘法运算 某人有三个儿子 有一个长度为N的数字串 有5座不同颜色的房子 最长子串 最大子矩阵之和 在字符串S中寻找最 写一个程序 写一个函数 二维数组排序 一个线段随机分成三段能够构成三角形的概率 一个int数组,里面数据无任何限制,要求求出所有这样的数a[i], 其左边的数都小于等于它,右边的数都大于等于它。 能否只用一个额外数组和少量其它空间实现。 How many 0 appears Fabonacci数列定义为 Do remember 骆驼吃香蕉问题 错排原理 逻辑推理宴会握手 输入一个整数n 设计一个系统处理词语搭配问题 设计一个不能被继承的 设七位数是 编写代码把16进制表示的串转换为3进制表示的串 每个飞机只有一个油箱 概率问题 桌面上有24张光滑面扑克牌 根据上排给出十个数 有一个长度为998的数组 有一个复杂链表 有81个选手 有5个人比赛 有2.5亿个整数存放在一个文件中 有10个文件 无限容量的体育馆 数列L中有n个整数 把一个钝角三角形 循环队列 外星人打算将地球用来种蘑菇 在一天的24小时之中 判断另一字符串的所有字母是否在母串中都有 判断一个数是4的整数次幂 全部有火柴根组成 你有一个横6竖6的方格 九宫图解法 两个数组 不能使用库函数 下一个数是什么 一道小学数学题可以证明你是否可以玩股票 一个猜测游戏中 一个文件 一个教授逻辑学的教授 \[约瑟夫环\]n个数字 Longest Common Subsequence Fibonacci 12个高矮不同的人 100层楼 1000瓶药水 0-1背包 正则表达式 随机洗牌:哪种算法正确 求连续自然数平方和的公式 各种算法复杂度比较 教你如何迅速秒杀掉:99%的海量数据处理面试题 _
exr xLua Paper2D rapidjson unreal源码赏析 NEON PainTown编译 scripting language low level graphics library 格斗引擎 ios性能测试 UI Engines Game Engines Comparison g3log Open Source Log Systems Comparison View Frustum Culling Matrix Layouts, DirectX and OpenGL DirectX基础知识 Physics Engines 透视投影变换 编译ogre_src_v1-7-4 windows 编译 ogre 1.9.0 ios undo 绘制次序 纹理寻址模式设置不当 显存带宽 bandwidth 分析碰撞检测库Opcode 《Fighting, Antiquity》遇见的各种问题 send TEXCOORD from DirectX9.0 to HLSL mul(inPos, matViewProjection) and mul(matViewProjection, inPos) A* Pathfinding X File Hierarchy Loading VS高亮HLSL关键字 Umbra 3:次世代的遮挡裁剪 Steering Behaviors For Autonomous Charac Rendering the Great Outdoors/Fast Occlusion Culling for Outdoor Environments Programming OpenGL ES with ios Perlin Noise OpenGL中freeglut的安装 OpenGL OpenGL ES hardware support OgreSDK_vc10_v1-7-4第一次编译程序运行crash Missing texture object named 'Texture0' in pixel shader 'Pixel Shader' in pass 'Pass 1' Loading .x files the easy way Load .obj model Get Texture Coordinates from DirectX in Vertex Shader Fx Composer Effect Framework DirectX 9.0中BeginPass和EndPass放置问题 DirectInput Coding in RenderMonkey Bézier curve Bullet Advanced Collision Detection Techniques 3D游戏引擎中的室外大场景渲染技术研究与实现 3D实时渲染中的BSP树和多边形剔除 fxc的使用及调试技巧 OGRE点滴积累

java 59

java基础知识 andriod源码编译 aar转jar JAR creation failed. See details for additional information 获取焦点 某些android系统下自动优化代码 异常处理 内存泄露分析 代码混淆 enum MultiValueMap eclipse的devices上不显示调试程序包名 获取版本号和版本名 js语法 meta-data的获取 smali语法 mobile devices information android 国际化语言 locale缩写 android error solutions 游戏崩溃查找dump crash堆栈信息 未签名的apk无法安装到手机上 延迟执行任务 平台接入 安装apk到手机中,elipse并非完全拷贝整个apk 多线程用多少个线程最合适 使用NDK编译so动态库 中国移动第三方接入 onNewIntent eclipse调试android程序 eclipse下android环境搭建 apk重启程序代码 apk 签名 ant 自动编译 android开发中遇到sqlite3 not found android制作九宫格图 android.database.CursorIndexOutOfBoundsException android 指定类 android ndk 开发之Application.mk android assets常见问题 android 4.0 NetworkOnMainThreadException ZXing竖屏解决(完美版) XP环境下java环境变量配置 Unable to execute dex/Multiple dex files define The nested fileset element is deprectated, use a nested path instead Re-installation failed due to different application signatures. ROM修改 NDK工具之 addr2line NDK和Eclipse的集成 MySQL相关 ListView无法在onCreate的时候getChildCount() JNI运用 Database Design/UUID vs Integer Auto-Increment Android点滴积累 Android查看内存 Android.mk文件详解 Android string Android NDK 官方下载地址 Adding ActionBar Items From Within Your Fragments Activity 生命周期

Do remember

2014年09月04日

Desc: 做出来了,或者理解了,但是速度太慢了,都记录在此.

answer:

more:


  1. 用天平(只能比较,不能称重)从一堆小球中找出其中唯一一个较轻的,使用x次天平,

    最多可以从y个小球中找出较轻的那个,求yx的关系式。
    answer:
    x=1, y=3: if a=b, c is the lighter, else the lighter is the lighter…

    do this recursively. so y=3\^x;

    more: Q:球一个天平,现知道只有一个和其它的重量不同,问怎样称才能用三次就找到那个球?

    A:13个球也是可以做的。就是分成4个、4个、5个,先拿两个四个上去,如果平衡,则问题出在5个那组,就在5个里任拿三个设为C1C2C3,再拿三个正常的,分别放两边,若平衡就简单啦,若不平衡,就出现C1C2C3重,或C1C2C3轻,相当于就知道那个特别的球是比较重或者比较轻啦,接下就不用说了

    如果不平衡,假设现在是A重B轻,

    取A1+A2+B1放天平一边(设为左边),

    再取A3+A4+B2放另一边(右),

    若平衡,就在B3/B4任拿一个跟C1上去称就行了,

    如果不平衡,那么假设

    情况一:左重

    则是A1/A2/B2有问题

    直接把A1A2放两边称,重的那个有问题,如果平

    衡就是B2有问题

    情况二:右重

    就是 A3/A4/B1有问题,方法同上

    ,,,,,称3次的话,最多可以辨别3的3次方,也就是27个球,传统的2的3次方只能辨别8个球.

  2. 输入一个字符串,打印出该字符串中字符的所有排列。例如输入字符串abc,则输出由字符abc所能排列出来的所有字符串abcacbbacbcacabcba

    \#include \<iostream\>\ \#include \<algorithm\>\ \#include \<iterator\>\ \#include \<cassert\>\ \ using std::cout;\ using std::cin;\ using std::endl;\ using std::copy;\ using std::ostream\_iterator;\ \ void PermuAuxi( char szStr[], int iStart, int iEnd ){\ if( iStart \>= iEnd ){\ copy( &szStr[0], &szStr[iEnd], ostream\_iterator\<char\>(cout, "") );\ cout \<\< endl;\ return;\ }\ \ for( int i = iStart; i \< iEnd; i++ ){\ std::swap( szStr[iStart], szStr[i] );\ PermuAuxi( szStr, iStart + 1, iEnd );\ std::swap( szStr[iStart], szStr[i] );\ }\ }\ void Permutation( char \*szStr ){ if( szStr == NULL ) return; PermuAuxi( szStr, 0, strlen(szStr) );\ }\ \ int main( int argc, char \*argv[] ){\ char szStr[256];\ cout \<\< "Input string:\\n";\ cin \>\> szStr;\ cout \<\< "Permutation:\\n";\ Permutation( szStr );\ }\ /\*Sample output:\ Input string:\ abc\ Permutation:\ abc\ acb\ bac\ bca\ cba\ cab\ 请按任意键继续. . .\ \*/
  3. 给定链表的头指针和一个结点指针,在O(1)时间删除该结点。\ 链表结点的定义如下:

    struct ListNode

    {

      int        m\_nKey;
    
      ListNode\*  m\_pNext;
    

    };

    函数的声明如下:

    void DeleteNode(ListNode* pListHead, ListNode* pToBeDeleted);

    分析:这是一道广为流传的Google面试题,能有效考察我们的编程基本功,还能考察我们的反应速度,更重要的是,还能考察我们对时间复杂度的理解。
    answer:\

    Copy the data from tobedeleted’s next to tobedeleted. then delete tobedeleted. The special case is

    tobedelete is the tail, then we must iterate to find its predecessor.

    The amortized time complexity is O(1).

    \ void DeleteNode(stNode\* pListHead, stNode\* pToBeDeleted){\ if( pListHead == NULL || pToBeDeleted == NULL ) return;\ \ \ stNode \*pNode = pToBeDeleted-\>\_next;\ if( pNode ){\ pToBeDeleted-\>\_data = pNode-\>\_data;\ pToBeDeleted-\>\_next = pNode-\>\_next;\ delete pNode;\ }\ }
  4. 一个岔路口分别通向诚实国和说谎国。来了两个人,已知一个是诚实国的,另一个是说谎国的。诚实国永远说实话,说谎国永远说谎话。现在你要去说谎国,但不知道应该走哪条路,需要问这两个人。请问应该怎么问?
    answer:
    A:路在左边,B说的话是错的.

    B:路在左边,A说的话是错的.

    如果有一个人说F,则那个人肯定是诚实国的人.并且相信他,路在右边

    如果都说T,则路肯定是在左边..

    因为说谎国的人对于以上两句话都只会回答T.

  5. 用递归的方法判断整数组a[N]是不是升序排列
  6. 不用乘法或加法增加7倍:\ 7 = 8 - 1 则:(x<<3)-x

    7 = (16-2)/2 则:(x<<4 - x<<1)>>1

  7. 输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变。句子中单词以空格符隔开。为简单起见,标点符号和普通字母一样处理。

    例如输入“I am a student.”,则输出“student. a am I”。

    \#include "stdafx.h"\ void ReverseStrOrder( char \*szStr ){\ assert( szStr );\ \ int len = strlen( szStr ); // Reverse string.\ int iPost = len - 1;\ int iPrev = 0;\ while( iPrev \< iPost ){\ szStr[iPrev] = szStr[iPrev] \^ szStr[iPost];\ szStr[iPost] = szStr[iPrev] \^ szStr[iPost];\ szStr[iPrev] = szStr[iPrev] \^ szStr[iPost];\ iPrev++;\ iPost--;\ }\ cout \<\< szStr \<\< endl;\ \ char \*p = szStr;\ char \*pFirst = NULL, \*pLast = NULL;\ while( \*p != '\\0' )\ {\ pFirst = p;\ while( \*p != '\\0' && \*p != ' '/\* && \*p != ',' && \*p != '.' && \*p != '!' && \*p != ';' \*/) p++;\ pLast = p - 1;\ \ while( pFirst \< pLast ) std::swap( \*pFirst++, \*pLast-- );\ \ if( \*p != '\\0' ) p++;\ }\ }\ int main(){\ char szStr[256] = "I am a student.";\ ReverseStrOrder( szStr );\ cout \<\< szStr \<\< endl;\ }\ /\*Sample output:\ .tneduts a ma I\ student. a am I\ 请按任意键继续. . .\ \*/
  8. 用一种算法使含通配符字符串相匹配.

    \#include "stdafx.h"\ \ bool IdxKMP( const char \*szMain, const char\* szSearch, const int pos, const int \*next ){\ assert( szMain != NULL && szSearch != NULL && next != NULL );\ \ int i = pos, j = 0;\ int lenMain = static\_cast\<int\>(strlen(szMain));\ int lenSearch = static\_cast\<int\>(strlen(szSearch));\ \ while( i \< lenMain && j \< lenSearch )\ {\ if( j == -1 || szMain[i] == szSearch[j] || szSearch[j] == '?' ){\ i++;\ j++;\ }\ else if( szSearch[j] == '\*' ){\ j++;\ while( i \< lenMain && szMain[i] != szSearch[j] ) i++;\ }\ else\ j = next[j];\ }\ \ if( j \>= lenSearch )\ return true;\ else\ return false;\ }\ \ void GetNext( const char \*szSearch, int \*next ){\ assert( szSearch != NULL && next != NULL );\ \ int i = 0, j = -1;\ int len = strlen( szSearch );\ next[0] = -1;\ while( i \< len - 1 )\ {\ if( j == -1 || szSearch[i] == szSearch[j] ){\ i++;\ j++;\ next[i] = j;\ }\ else\ j = next[j];\ }\ \ }\ bool Wildcard( const char \*szMain, const char\* szSearch ){\ assert( szMain != NULL && szSearch != NULL );\ \ int \*next = NULL;\ next = new int[strlen(szSearch)];\ // Preprocess.\ GetNext( szSearch, next );\ \ // Process.\ bool ret = IdxKMP( szMain, szSearch, 0, next );\ \ // Postprocess.\ delete []next;\ \ return ret;\ }\ int main(){\ const char \*sMain("My notadepad");\ const char \*sSearch("\*not\*p?d");\ cout \<\< std::boolalpha \<\< Wildcard( sMain, sSearch ) \<\< endl;\ }
  9. 有n个长为m+1的字符串,如果某个字符串的最后m个字符与某个字符串的前m个字符匹配,则两个字符串可以联接,问这n个字符串最多可以连成一个多长的字符串,如果出现循环,则返回错误。
    Caution: 注意审清题,m+1的长度的字符串,m个字符要匹配,联接不是合并.

    \#include \<iostream\>\ \#include \<string\>\ \#include \<climits\>\ \#include \<cmath\>\ \#include \<fstream\>\ \#include \<vector\>\ \ using namespace std;\ \ \#define INFINITY INT\_MAX\ \#define MAX\_VERTEX\_NUM 100\ \ int m;\ typedef struct{\ int \*vexs;\ int (\*arcs)[MAX\_VERTEX\_NUM];\ int vexnum, arcnum;\ }MGraph;\ \ struct stMatGraph{\ explicit stMatGraph( int nVex, string \*pVertices = NULL, bool \*\*ppArcs = NULL )\ :\_nVex(nVex), \_pVertices(pVertices), \_ppArcs(ppArcs){}\ \ string \*\_pVertices;\ bool \*\*\_ppArcs;\ \ int \_nVex;\ };\ \ bool IsMatched( const string &str1, const string &str2 ){\ int idx1 = m;\ int idx2 = m - 1;\ while( idx2 \>= 0 && str1[idx1] == str2[idx2] ){\ idx1--;\ idx2--;\ }\ \ if( idx2 \< 0 )\ return true;\ else\ return false;\ }\ \ void CreateGraph( stMatGraph \*pGraph, vector\<string\> &vecStr ){\ \ pGraph-\>\_nVex = vecStr.size();\ pGraph-\>\_pVertices = new string[pGraph-\>\_nVex];\ for( int i = 0; i \< pGraph-\>\_nVex; i++ )\ pGraph-\>\_pVertices[i] = vecStr[i];\ \ pGraph-\>\_ppArcs = new bool \*[pGraph-\>\_nVex];\ for( int i = 0; i \< pGraph-\>\_nVex; i++ ){\ pGraph-\>\_ppArcs[i] = new bool[pGraph-\>\_nVex];\ memset( pGraph-\>\_ppArcs[i], 0, sizeof(bool)\*pGraph-\>\_nVex );\ }\ \ for( int i = 0; i \< pGraph-\>\_nVex; i++ )\ for( int j = 0; j \< pGraph-\>\_nVex; j++ ){\ pGraph-\>\_ppArcs[i][j] = IsMatched( pGraph-\>\_pVertices[i], pGraph-\>\_pVertices[j] );\ }\ }\ \ \ void DeleteMatGraph( stMatGraph \*pGraph ){\ for( int i = 0; i \< pGraph-\>\_nVex; i++ )\ delete [](pGraph-\>\_ppArcs[i]); /\*[]pGraph-\>\_ppArcs[i]?\*/\ delete []pGraph-\>\_ppArcs;\ delete []pGraph-\>\_pVertices;\ }\ \ bool g\_bVisited[MAX\_VERTEX\_NUM];\ std::vector\<string\> g\_vecStrRecord;\ int Count = 0;\ int MaxCount = numeric\_limits\<int\>::min();\ bool g\_bContinued = true;\ /\*\ void DFSAuxi( stMatGraph \*pGraph, int i ){\ if( g\_bContinued )\ {\ g\_bVisited[i] = true;\ \ g\_vecStrRecord.push\_back( pGraph-\>\_pVertices[i] );\ Count++;\ if( MaxCount \< Count ){\ MaxCount = Count;\ \ // Test circular.\ vector\<string\>::iterator iter = g\_vecStrRecord.begin();\ string strLast = g\_vecStrRecord.back();\ \ int idx1 = 1, idx2 = 0;\ while( idx1 \< m + 1 && (\*iter)[idx1++] == strLast[idx2++] )\ ;\ if( idx1 \>= m + 1 ){\ cerr \<\< "Have circular.\\n";\ g\_bContinued = false;\ return;\ }\ \ for( ; iter != g\_vecStrRecord.end(); iter++ )\ cout \<\< \*iter \<\< " ";\ cout \<\< endl;\ }\ for( int j = 0; j \< pGraph-\>\_nVex; j++ ){\ if( pGraph-\>\_ppArcs[i][j] && !g\_bVisited[j] )\ DFSAuxi( pGraph, j );\ }\ Count--;\ g\_vecStrRecord.pop\_back();\ g\_bVisited[i] = false;\ }\ }\ \*/\ void DFSAuxi( stMatGraph \*pGraph, int i ){\ g\_bVisited[i] = true;\ \ g\_vecStrRecord.push\_back( pGraph-\>\_pVertices[i] );\ Count++;\ if( MaxCount \< Count ){\ MaxCount = Count;\ \ vector\<string\>::iterator iter = g\_vecStrRecord.begin();\ for( ; iter != g\_vecStrRecord.end(); iter++ )\ cout \<\< \*iter \<\< " ";\ cout \<\< endl;\ }\ for( int j = 0; j \< pGraph-\>\_nVex; j++ ){\ if( pGraph-\>\_ppArcs[i][j] && !g\_bVisited[j] )\ DFSAuxi( pGraph, j );\ }\ Count--;\ g\_vecStrRecord.pop\_back();\ g\_bVisited[i] = false;\ }\ \ void DFSTraverse( stMatGraph \*pGraph ){\ for( int i = 0; i \< pGraph-\>\_nVex; i++ )\ if( !g\_bVisited[i] )\ DFSAuxi( pGraph, i );\ }\ int main(){\ int n;\ ifstream inFile("2.txt");\ cout \<\< "Input the number of string:\\n";\ cin \>\> n;\ cout \<\< "Input the length of string:\\n";\ cin \>\> m;\ m--;\ vector\<string\> vecStr;\ string str;\ for( int i = 0; i \< n; i++ ){\ cin \>\> str;\ vecStr.push\_back( str );\ }\ cout \<\< endl;\ \ stMatGraph \*pGraph = new stMatGraph( n );\ CreateGraph( pGraph, vecStr );\ DFSTraverse( pGraph );\ cout \<\< "Maximum count:" \<\< MaxCount \<\< endl;\ \ DeleteMatGraph( pGraph );\ \ delete pGraph;\ }\ /\*\ Input the number of string:\ 14\ Input the length of string:\ 4\ abcd\ bcde\ cdea\ deab\ eaba\ abab\ deac\ cdei\ bcdf\ cdfi\ dfic\ cdfk\ bcdg\ babc\ \ abcd\ abcd bcde\ abcd bcde cdea\ abcd bcde cdea deab\ abcd bcde cdea deab eaba\ abcd bcde cdea deab eaba abab\ abcd bcde cdea deab eaba abab babc\ bcde cdea deab eaba abab babc abcd bcdf\ bcde cdea deab eaba abab babc abcd bcdf cdfi\ bcde cdea deab eaba abab babc abcd bcdf cdfi dfic\ Maximum count:10\ 请按任意键继续. . .\ \*/
  10. 一个整数数组,长度为n,将其分为m份,使各份的和相等,求m的最大值\

    </span>比如{3243**6} **可以分成{3243**6} m=1; **

    {3,6}{2,4,3} m=2

    **{3,3}{2,4}{6} m=3 **所以m的最大值为3。

    \#include "stdafx.h"\ const int gc\_Size = 8;\ int arr[gc\_Size] = {1,1,1,3,2,4,3,6};\ int g\_iChosen[gc\_Size];\ \ bool StatSum( int nCntChosen, int leftSum ){\ bool ret = false;\ if( leftSum \< 0 ) return false;\ if( leftSum == 0 ) return true;\ \ for( int i = 0; i \< gc\_Size; i++ ){\ if( g\_iChosen[i] == 0 && !ret ){\ g\_iChosen[i] = nCntChosen + 1;\ bool tmpRet = StatSum( nCntChosen, leftSum - arr[i]);\ ret |= tmpRet;\ if( !tmpRet ) g\_iChosen[i] = 0;\ }\ }\ \ return ret;\ }\ \ // Return maximum split pieces.\ int AverSplit(){\ int sumTotal = accumulate( &arr[0], &arr[gc\_Size], 0 );\ // You have to sort by ascending order.\ // 当你选择的时候,越大的是在n个slice中唯一一个splitted的数组中的\ // 例如: 1,1,1,2,3,3,4,6.\ // 如果1,1,1,4入选,则不行.\ // 6则是其中一个splitted数组的不二选择.\ sort( &arr[0], &arr[gc\_Size], greater\<int\>() );\ \ int maxSlice = 1;\ int slice = 2;\ // slice肯定是sumTotal的余数,并且不可能大于arr的最大的数.\ while( slice \< sumTotal/2 && sumTotal/slice \>= arr[0] )\ {\ while( sumTotal % slice != 0 ){\ slice++;\ if( !(slice \< (sumTotal \>\> 2) && sumTotal/slice \>= arr[0]) )\ break;\ }\ \ memset( g\_iChosen, 0, sizeof(int)\*gc\_Size );\ int nCntChosen = 0;\ int sumSplitted = sumTotal/slice;\ while( nCntChosen \< slice ){\ if( StatSum( nCntChosen, sumSplitted) )\ nCntChosen++;\ else\ break;\ }\ if( nCntChosen \>= slice )\ maxSlice = slice;\ slice++;\ }\ \ \ return maxSlice;\ }\ \ int main(){\ cout \<\< AverSplit() \<\< endl;\ }
  11. 求一个数组的最长递减子序列 比如{94325432}的最长递减子序列为{95432}

    \#include "stdafx.h"\ /\*\ 求一个数组的最长递减子序列 比如{9,4,3,2,5,4,3,2}的最长递减子序列为{9,5,4,3,2}.\ \*/\ const int gc\_iSize = 9;\ int arr[gc\_iSize] = {7,9,4,6,2,5,4,3,5};\ int seq[gc\_iSize][gc\_iSize];\ \ int GetLDS(){\ int ret = 0;\ seq[0][0] = 1;\ // [i] 第i个序列.\ // [j] 选中第j个数.\ for( int i = 1; i \< gc\_iSize; i++ )\ for( int j = 0; j \< gc\_iSize; j++ )\ {\ if( i == 0 || j == 0 ){\ if( arr[i] \<= arr[j] )\ seq[i][j] = 2;\ else\ seq[i][j] = 1;\ }\ else if( i \> j && arr[i] \<= arr[j] )\ seq[i][j] = std::max( seq[j][j] + 1, seq[i][j-1] );\ else\ seq[i][j] = seq[i][j-1];\ }\ for( int i = 0; i \< gc\_iSize; i++ )\ {\ for( int j = 0; j \< gc\_iSize; j++ ){\ cout \<\< seq[i][j] \<\< " ";\ }\ cout \<\< endl;\ }\ \ return seq[gc\_iSize-1][gc\_iSize-1];\ }\ int main(){\ cout \<\< GetLDS() \<\< endl;\ }\ \ /\*\ 1 0 0 0 0 0 0 0 0\ 1 1 1 1 1 1 1 1 1\ 2 2 2 2 2 2 2 2 2\ 2 2 2 2 2 2 2 2 2\ 2 2 3 3 3 3 3 3 3\ 2 2 2 3 3 3 3 3 3\ 2 2 3 3 3 4 4 4 4\ 2 2 3 3 3 4 5 5 5\ 2 2 2 3 3 4 4 4 4\ 4\ 请按任意键继续. . .\ \*/
  12. 输入一个正整数数组,将它们连接起来排成一个数,输出能排出的所有数字中最小的一个。

    例如输入数组{32,** </span>321}**,则输出这两个能排成的最小数字32132

    请给出解决问题的算法,并证明该算法。

    \#include "stdafx.h"\ \ /\*\ 输入一个正整数数组,将它们连接起来排成一个数,输出能排出的所有数字中最小的一个。\ 例如输入数组{32, 321},则输出这两个能排成的最小数字32132。\ 请给出解决问题的算法,并证明该算法。\ \*/\ const int gc\_Size = 5;\ const int gc\_MaxNumLength = 10;\ int arr[gc\_Size] = { 32, 321, 123, 422, 43 };\ char \*g\_szStr1 = new char[gc\_MaxNumLength\*2+1];\ char \*g\_szStr2 = new char[gc\_MaxNumLength\*2+1];\ \ int CMP( const void \*str1, const void \*str2 ){\ strcpy( g\_szStr1, \*(const char\*\*)str1 );\ strcat( g\_szStr1, \*(const char\*\*)str2 );\ \ strcpy( g\_szStr2, \*(const char\*\*)str2 );\ strcat( g\_szStr2, \*(const char\*\*)str1 );\ \ return strcmp( g\_szStr1, g\_szStr2 );\ }\ void DoTask(){\ char \*\*ppStr = NULL;\ ppStr = new char \*[gc\_MaxNumLength+1];\ for( int i = 0; i \< gc\_Size; i++ ){\ \*(ppStr + i) = new char[gc\_MaxNumLength+1];\ sprintf( \*(ppStr +i), "%d", arr[i] );\ }\ qsort( ppStr, gc\_Size, sizeof(char\*), CMP );\ \ for( int i = 0; i \< gc\_Size; i++ )\ cout \<\< \*(ppStr + i) \<\< " ";\ \ for( int i = 0; i \< gc\_Size; i++ )\ delete [](\*(ppStr + i));\ delete []ppStr;\ }\ \ int main(){\ DoTask();\ delete []g\_szStr1;\ delete []g\_szStr2;\ }
  13. 函数将字符串中的字符’*‘移到串的前部分,前面的非’*‘字符后移,但不能改变非’*‘字符的先后顺序,

    函数返回串中字符’*‘的数量。如原始串为:ab**cd**e*12,

    处理后为*****abcde12,函数并返回值为5。(要求使用尽量少的时间和辅助空间)。

    \#include "stdafx.h"\ /\*\ 函数将字符串中的字符'\*'移到串的前部分,前面的非'\*'字符后移,但不能改变非'\*'字符的先后顺序,\ 函数返回串中字符'\*'的数量。如原始串为:ab\*\*cd\*\*e\*12,\ 处理后为\*\*\*\*\*abcde12,函数并返回值为5。(要求使用尽量少的时间和辅助空间)\ \*/\ /\*\ \#include "stdafx.h"\ \ int MoveAsterisk( char \*str ){\ assert( str != NULL );\ \ int len = strlen( str );\ int iAsterisk = len - 1;\ int iNonAsterisk = len - 1;\ int nCnt = 0;\ \ // Find first asterisk.\ while( iAsterisk \>= 0 && str[iAsterisk] != '\*' ) iAsterisk--;\ iNonAsterisk = iAsterisk - 1;\ \ while( iAsterisk \>= 0 && iNonAsterisk \>= 0 )\ {\ while( iAsterisk \>= 0 && str[iAsterisk] != '\*' ) iAsterisk--;\ while( iNonAsterisk \>= 0 && str[iNonAsterisk] == '\*' ){ iNonAsterisk--;}\ if( iAsterisk \>= 0 && iNonAsterisk \>= 0 ){\ str[iAsterisk] = str[iAsterisk] \^ str[iNonAsterisk];\ str[iNonAsterisk] = str[iAsterisk] \^ str[iNonAsterisk];\ str[iAsterisk] = str[iAsterisk] \^ str[iNonAsterisk];\ nCnt++;\ }\ }\ \ return nCnt;\ }\ \*/\ int MoveAsterisk( char \*szStr ){\ assert( szStr != NULL );\ \ int len = strlen( szStr );\ \ char \*pAsterisk = szStr + len - 1;\ char \*pNonAsterisk = szStr + len - 1;\ \ while( pAsterisk \>= szStr ){\ if( \*pAsterisk != '\*' )\ \*pNonAsterisk-- = \*pAsterisk;\ pAsterisk--;\ }\ \ int nCnt = pNonAsterisk - pAsterisk;\ while( pNonAsterisk \>= szStr )\ \*pNonAsterisk-- = '\*';\ \ return nCnt;\ }\ \ int main(){\ char str[256] = "ab\*\*cd\*\*e\*12";\ cout \<\< MoveAsterisk( str ) \<\< endl;\ cout \<\< str \<\< endl;\ }
  14. 求两个串中的第一个最长子串.

    如”abractyeyt”,”dgdsaeactyey”的最大子串为”actyet”。

    \#include "stdafx.h"\ /\*\ 求两个串中的第一个最长子串.\ 如"abractyeyt","dgdsaeactyey"的最大子串为"actyet"。\ \*/\ \ // Get first longest substring.\ void GetFLS( char \*pOut, const char \*str1, const char \*str2 ){\ assert( pOut != NULL && str1 != NULL && str2 != NULL );\ \ const char \*p1 = str1;\ const char \*p2 = str2;\ const char \*pMaxIdx = NULL;\ int maxLen = 0;\ while( \*p1 != '\\0' )\ {\ p2 = str2;\ while( \*p2 != '\\0' )\ {\ const char \*pTmp1 = p1;\ while( \*p2 != '\\0' && \*pTmp1 != \*p2 ) p2++;\ \ while( \*pTmp1 != '\\0' && \*p2 != '\\0' && \*pTmp1 == \*p2 ){\ pTmp1++;\ p2++;\ }\ \ if( maxLen \< pTmp1 - p1 ){\ maxLen = pTmp1 - p1;\ pMaxIdx = p1;\ }\ }\ \ p1++;\ }\ \ if( pMaxIdx ){\ while( maxLen-- ) \*pOut++ = \*pMaxIdx++;\ }\ \ \*pOut = '\\0';\ \ }\ \ int main(){\ char str1[256] = "abractyeyt";\ char str2[256] = "dgdsaeactyey";\ char result[256];\ GetFLS( result, str1, str2 );\ cout \<\< result \<\< endl;\ }\ /\*\ actyey\ 请按任意键继续. . .\ \*/
  15. 给出洗牌的一个算法,并将洗好的牌存储在一个整形数组里.

    \#include "stdafx.h"\ /\*\ 给出洗牌的一个算法,并将洗好的牌存储在一个整形数组里.\ \*/\ inline int RandInt( int low,int high ){\ return rand()%(high-low+1) + low;\ }\ void Shuffle( int \*poker, int N = 54 ){\ srand( (unsigned)time(NULL) ) ;\ \ for( int i = 0; i \< N; i++ )\ poker[i] = i;\ \ for( int i = 0; i \< N; i++ )\ std::swap( poker[i], poker[RandInt(i,N-1)] );\ }\ \ int main(){\ /\*\ 0 \~ 12 代表红桃\ 13 \~ 25 代表黑桃\ 26 \~ 38 代表方块\ 39 \~ 51 代表梅花\ 52 \~ 53 代表大小王\ \*/\ int poker[54];\ Shuffle( poker );\ copy( &poker[0], &poker[54], ostream\_iterator\<int\>(cout, " ") );\ cout \<\< endl;\ }
  16. 写一个函数,检查字符串是否是整数,如果是,返回其整数值。

    (或者:怎样只用4行代码编写出一个从字符串到长整形的函数?)

    \#include "stdafx.h"\ /\*\ 写一个函数,检查字符串是否是整数,如果是,返回其整数值。\ (或者:怎样只用4行代码编写出一个从字符串到长整形的函数?)\ \*/\ long Str2Long( const char \*szStr, int len ){\ if( len \> 2 )\ return Str2Long( szStr, len - 1 )\*10 + (szStr[0] == '-' ? -(int)(unsigned char)szStr[len-1] + '0' : (int)(unsigned char)szStr[len-1] - '0');\ else\ return szStr[0] == '-' ? -(int)(unsigned char)szStr[1] + '0' : (szStr[0] == '+' ? (int)(unsigned char)szStr[1] - '0' : (((int)(unsigned char)szStr[0] - '0')\*10 + (int)(unsigned char)szStr[1] - '0'));\ }\ \ int main(){\ char szStr[256] = "-1245";\ cout \<\< Str2Long( szStr, 5 ) \<\< endl;\ }
  17. 求整数随机数构成的数组中找到长度>=3的最长的等差数列

    输出等差数列由小到大**: **

    如果没有符合条件的就输出[0,0]

    格式:

    输入[1,3,0,5,-1,6]

    输出[-1,1,3,5]

    要求时间复杂度,空间复杂度尽量小.

    \#include "stdafx.h"\ /\*\ 求整数随机数构成的数组中找到长度\>=3的最长的等差数列\ 输出等差数列由小到大: \ 如果没有符合条件的就输出[0,0]\ 格式:\ 输入[1,3,0,5,-1,6]\ 输出[-1,1,3,5]\ 要求时间复杂度,空间复杂度尽量小.\ \*/\ const int gc\_iSize = 6;\ int arr[gc\_iSize] = {1,3,0,5,-1,6};\ \ // Get longest Arithmetic Progression.\ void GetLAP(){\ sort( &arr[0], &arr[gc\_iSize] );\ \ int len = arr[gc\_iSize-1] - arr[0];\ int \*cntPro = new int[len];\ memset( cntPro, 0, sizeof(int)\*len );\ \ int \*ai = new int[len];\ for( int i = 0; i \< gc\_iSize; i++ )\ for( int j = i + 1; j \< gc\_iSize; j++ )\ {\ int d = arr[j] - arr[i];\ if( cntPro[d] == 0 ){\ ai[d] = arr[j];\ cntPro[d]++;\ }\ else{\ if( d == arr[i] - ai[d] )\ cntPro[d]++;\ }\ }\ \ int idxMax = 0;\ for( int i = 1; i \< len; i++ )\ if( cntPro[idxMax] \< cntPro[i] ){\ idxMax = i;\ }\ \ int cnt = cntPro[idxMax];\ for( int i = 0; i \< gc\_iSize; i++ )\ for( int j = i + 1; j \< gc\_iSize; j++ )\ {\ if( idxMax == arr[j] - arr[i] ){\ if( cnt-- == idxMax )\ cout \<\< arr[i] \<\< " ";\ cout \<\< arr[j] \<\< " ";\ }\ }\ cout \<\< endl;\ \ delete []cntPro;\ delete []ai;\ }\ int main(){\ GetLAP();\ }
  18. 输入一个字符串,输出该字符串中对称的子字符串的最大长度。

    比如输入字符串“google”,由于该字符串里最长的对称子字符串是“goog”,因此输出4

    \#include "stdafx.h"\ /\*\ 输入一个字符串,输出该字符串中对称的子字符串的最大长度。\ 比如输入字符串“google”,由于该字符串里最长的对称子字符串是“goog”,因此输出4。\ \*/\ // Get longest symmetry substring.\ void GetLSS( char \*pOut, const char \*str ){\ assert( pOut != NULL && str != NULL );\ \ const char \*p = str;\ \ const char \*maxP = NULL;\ int maxNum = numeric\_limits\<int\>::min();\ if( p[0] == p[1] ){\ maxNum = 2;\ maxP = p;\ }\ p++;\ while( \*p != '\\0' && \*(p+1) != '\\0' )\ {\ int idx = 1;\ while( (p-idx) \>= str && \*(p+idx) != '\\0' && \*(p-idx) == \*(p+idx) ){\ if( maxNum \< 2\*idx+1 ){ maxNum = 2\*idx+1; maxP = p-idx; }\ idx++;\ }\ \ idx = 1;\ while( (p-idx+1) \>= str && \*(p+idx) != '\\0' && \*(p-idx+1) == \*(p+idx) ){\ if( maxNum \< 2\*idx ){ maxNum = 2\*idx; maxP = p-idx+1; }\ idx++;\ }\ p++;\ }\ \ cout \<\< maxNum \<\< endl;\ \ for( int i = 0; i \< maxNum; i++ )\ \*(pOut + i) = \*(maxP + i);\ \*(pOut + maxNum) = '\\0';\ }\ int main(){\ char szStr[256] = "google";\ char pOut[256];\ GetLSS( pOut, szStr );\ \ cout \<\< pOut \<\< endl;\ }
  19. 求最大连续递增数字串(如“ads3sl456789DF3456ld345AA”中的“456789).

    \#include "stdafx.h"\ /\*\ 求最大连续递增数字串(如“ads3sl456789DF3456ld345AA”中的“456789”.\ \*/\ void GetMCID( char \*pOut, const char \*szStr ){\ assert( pOut != NULL && szStr != NULL );\ \ int nCnt = 0;\ int nMaxCnt = 0;\ const char \*pRecord = NULL;\ const char \*p = szStr;\ while( \*p != '\\0' )\ {\ int c = (int)(unsigned char)\*p;\ nCnt = 0;\ if( isdigit(c) )\ {\ nCnt++;\ if( nMaxCnt \< nCnt ){ pRecord = p; nMaxCnt = nCnt; }\ p++;\ while( \*p != '\\0' && isdigit(c) ){\ if( (int)(unsigned char)\*p != c + 1 )\ break;\ \ nCnt++;\ if( nMaxCnt \< nCnt ){ pRecord = p; nMaxCnt = nCnt; }\ c = (int)(unsigned char)\*p;\ p++;\ }\ }\ p++;\ }\ \ \*(pOut + nMaxCnt) = '\\0';\ while( --nMaxCnt \>= 0 ){\ \*(pOut + nMaxCnt) = \*pRecord--;\ }\ \ }\ \ int main(){\ char szStr[256] = "ads3sl456789DF3456ld345AA";\ char szOut[256];\ GetMCID( szOut, szStr );\ \ cout \<\< szOut \<\< endl;\ }
  20. 一串首尾相连的珠子(m个),有N种颜色(N<=10),设计一个算法,取出其中一段,要求包含所有N中颜色,并使长度最短。并分析时间复杂度与空间复杂度。

    \#include "stdafx.h"\ /\*\ 一串首尾相连的珠子(m个),有N种颜色(N\<=10),\ 设计一个算法,取出其中一段,要求包含所有N中颜色,并使长度最短。\ 并分析时间复杂度与空间复杂度。\ \*/\ int num[10];\ void GetShortestStrContainN( const string &str, string &shortestStr ){\ int iStart = 0, iEnd = 0;\ int iDone = 0x0;\ int iShortestLen = str.length();\ int iLen = str.length();\ int iRecordStart = 0;\ \ // First, stat. the the string with N colors.\ while( iDone != 0x3ff ){\ iDone |= 0x1 \<\< (str[iEnd] - '0');\ num[str[iEnd] - '0']++;\ iEnd++;\ }\ iEnd--;\ \ while( iStart \< iLen )\ {\ int iCurLen;\ if( iEnd \> iStart )\ iCurLen = iEnd - iStart + 1;\ else\ iCurLen = iEnd + iLen - iStart;\ \ if( iShortestLen \> iCurLen){\ iShortestLen = iCurLen;\ iRecordStart = iStart;\ }\ \ while( iStart \< iLen && num[str[iStart] - '0'] \<= 1 ){\ iEnd = (iEnd + 1)%iLen;\ if( iEnd == iStart )\ iStart++;\ else\ num[str[iEnd]-'0']++;\ }\ num[str[iStart]-'0']--;\ iStart++;\ }\ \ cout \<\< "start:" \<\< iRecordStart \<\< ", len:" \<\< iShortestLen \<\< endl;\ if( iLen - iRecordStart \< iShortestLen ){\ shortestStr = str.substr( iRecordStart );\ shortestStr += str.substr( 0, iShortestLen - iLen + iRecordStart );\ }\ else\ shortestStr.assign( str, iRecordStart, iShortestLen );\ }\ \ int main(){\ string str;\ string sMain;\ cin \>\> sMain;\ GetShortestStrContainN( sMain, str );\ cout \<\< str \<\< endl; \ }\ /\*\ 0134521065768921201221411\ start:2, len:12\ 345210657689\ 请按任意键继续. . .\ \ 6576892120122141101345210\ start:19, len:11\ 34521065768\ 请按任意键继续. . .\ \*/
  21. 一个100米长的部队行军,一个传令兵从队伍尾到队伍头,然后再从队伍头返回队伍尾,这时队伍正好走了100米,整个过程队伍和传令兵的速度不变,那么传令兵走了多少米?

    设士兵速度x,队伍y

    [100/(x-y)+100/(x+y)]*y=100

    解得

    x=(1+根号2)y

    路程与速度成正比(时间相同)

    士兵路程为100(1+根号2)

    就是241.4米左右。

  22. 两个圆相交,交点是A1,A2。现在过A1点做一直线与两个圆分别相交另外一点B1,B2。

    B1B2可以绕着A1点旋转。问在什么情况下,B1B2最长.
    当A1A2⊥B1B2时B1B2最长

    设弦A1B1、A1B2所在圆分别为⊙O1、⊙O2,取A1B1、A1B2的中点C、D,连结O1C、O2D

    则B1B2=A1B1+A1B2=2A1C+2A1D=2CD

    当A1A2与B1B2不垂直时,四边形O1O2DC是直角梯形,定有O1O2>CD

    此时B1B2=2CD<2O1O2

    当A1A2⊥B1B2时,四边形O1O2DC是矩形,定有O1O2=CD

    此时B1B2=2CD=2O1O2为最大.

  23. 用测量器和50** **如何测量河对岸的巨石高度?\ \ 通过测量h和d求出θ角,然后沿河岸走一定距离\

    剪贴板20121801185954122.jpg
    成θ角的时候X即为所求.</span>

  24. Fibonacci数列中第k个与前面所有数互质的数(除前面两个数 11 )。