gdb命令整理
Microsoft Windows XP [版本 5.1.]
(C) 版权所有 - Microsoft Corp. C:\Documents and Settings\Administrator>e: E:\>dir
驱动器 E 中的卷没有标签。
卷的序列号是 000A-A2B1 E:\ 的目录 -- : <DIR> ADSafe
-- : <DIR> OIPackages
-- : <DIR> QQ
-- : <DIR> sougou
个文件 字节
个目录 ,,, 可用字节 E:\>cd OIPackages E:\OIPackages>cd Dev-Cpp E:\OIPackages\Dev-Cpp>cd MinGW32 E:\OIPackages\Dev-Cpp\MinGW32>cd bin E:\OIPackages\Dev-Cpp\MinGW32\bin>g++ -g e:\a.cpp -o a
g++: e:\a.cpp: No such file or directory
g++: no input files E:\OIPackages\Dev-Cpp\MinGW32\bin>g++ -g f:\a.cpp -o a E:\OIPackages\Dev-Cpp\MinGW32\bin>gdb a
GNU gdb 6.8
Copyright (C) Free Software Foundation, Inc.
License GPLv3+: GNU GPL version or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) l
return pos==a.pos?r<a.r:pos<a.pos;
}
}b[N];
int n,m,l,r,a[N],f[N];
ll res,ans1[N],ans2[N];
ll gcd(ll a,ll b){
if(!b) return a;
return gcd(b,a%b);
}
int main(){
(gdb)
//freopen("hose.in","r",stdin);
//freopen("hose.out","w",stdout);
n=read();m=read();
for(int i=;i<=n;i++) a[i]=read();
int k=sqrt(n*1.0)+0.5;
for(int i=;i<=m;i++){
b[i].l=read();b[i].r=read();
b[i].t=i;b[i].pos=b[i].l/k;
}
sort(b+,b+m+);
(gdb)
memset(f,,sizeof f);
l=;r=;res=;
for(int i=;i<=m;i++){
while(r>b[i].r){
res-=(ll)f[a[r]]-;
f[a[r]]--;
r--;
}
while(r<b[i].r){
r++;
(gdb)
f[a[r]]++;
res+=(ll)f[a[r]]-;
}
while(l>b[i].l){
l--;
f[a[l]]++;
res+=(ll)f[a[l]]-;
}
while(l<b[i].l){
res-=(ll)f[a[l]]-;
(gdb)
f[a[l]]--;
l++;
}
ans1[b[i].t]=res;
ans2[b[i].t]=(ll)(r-l+)*(r-l)/;
}
for(int i=;i<=m;i++){
if(!ans1[i]){
puts("0/1");
continue;
(gdb)
}
ll gg=gcd(ans1[i],ans2[i]);
printf("%lld/%lld\n",ans1[i]/gg,ans2[i]/gg);
//printf("%I64d/%I64d\n",ans1[i]/gg,ans2[i]/gg);
}
return ;
}(gdb)
Line number out of range; f:\a.cpp has lines.
(gdb)
Line number out of range; f:\a.cpp has lines.
(gdb) b
Breakpoint at 0x40178a: file f:\a.cpp, line .
(gdb) b if i=
No default breakpoint address now.
(gdb) n
The program is not being run.
(gdb) s
The program is not being run.
(gdb) continue
The program is not being run.
(gdb) p i
No symbol "i" in current context.
(gdb) p n
$ =
(gdb) p *a@N
$ = { <repeats times>}
(gdb) display i
No symbol "i" in current context.
(gdb) i b
Num Type Disp Enb Address What
breakpoint keep y 0x0040178a in main at f:\a.cpp:
(gdb) set i=
Ambiguous set command "i=100": .
(gdb) p gcd(,)
You can't do that without a process to debug.
(gdb)
未完待续
gdb命令整理的更多相关文章
- GDB技巧整理
https://blog.atime.me/note/gdb-tricks.html 整理常用的gdb技巧. 常用命令 常用的gdb命令... 启动gdb 直接运行 gdb --args prog a ...
- GDB命令行最基本操作
程序启动: A.冷启动 gdb program e.g., gdb ./cs gdb –p pid e.g., gdb –p `pidof c ...
- IOS开发--常用的基本GDB命令
gdb不是万能的,可是没有gdb却是万万不能的.这里给大家简单介绍下iOS开发中最基本的gdb命令. po po是print-object的简写,可用来打印所有NSObject对象.使用举例如下: ( ...
- jLink(v8)GDB 命令总结
/** ****************************************************************************** * @author Maox ...
- Linux学习笔记15——GDB 命令详细解释【转】
GDB 命令详细解释 Linux中包含有一个很有用的调试工具--gdb(GNU Debuger),它可以用来调试C和C++程序,功能不亚于Windows下的许多图形界面的调试工具. 和所有常用的调试工 ...
- 常用git命令整理
花了一点时间来熟悉和整理git常用命令. 推荐的git学习资料:1.搜“Git Community Book 中文版.pdf”,git社区书,内容全面且简明扼要,第一推荐2.搜“Git权威指南.pdf ...
- Xcode GDB 命令list
此文下半部分为转载:但是这里有一些我自己使用技巧,结合下面的文章,我们会有更多的收获,在此感谢原创者. --------------------- 关于调试异常崩溃: 一般崩溃是由内存使用错误 ...
- 常用的shell命令整理
工作快一年了,shell命令也玩了一年了.还是有点积累的,下面是本人常用的. 1.pwd | xargs -i basename {} 获取当前所在目录的名称 2.ps -ef|grep -w ...
- Windows常用的一些DOS命令整理
Windows常用的一些DOS命令整理.. MS DOS 命令大全 ---清空Dos屏幕使用命令:cls -- Dos切换当前目录到D盘:cd d: 一.基础命令 1 dir 无参数:查看当前所在目录 ...
随机推荐
- js变量数组
<html><head lang="en"> <meta charset="UTF-8"> <title>< ...
- (转)Eclipse中使用Ant
Eclipse中使用Ant 分类: JAVA 工具 服务器2014-08-05 09:59 5507人阅读 评论(0) 收藏 举报 anteclipse http://286.iteye.com/bl ...
- PAT (Advanced Level) 1067. Sort with Swap(0,*) (25)
只对没有归位的数进行交换. 分两种情况: 如果0在最前面,那么随便拿一个没有归位的数和0交换位置. 如果0不在最前面,那么必然可以归位一个数字,将那个数字归位. 这样模拟一下即可. #include& ...
- 一个门外汉的理解 ~ Faster R-CNN
首先放R-CNN的原理图 显然R-CNN的整过过程大致上划分为四步: 1.输入图片 2.生成候选窗口 3.对局部窗口进行特征提取(CNN) 4.分类(Classify regions) 而R-CNN的 ...
- Tomcat安装与配置
Tomcat概述Tomcat是Apache 软件基 金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache.Sun 和其他一些公司及个人共同 ...
- JS基础知识——定时器
1.定时器——setInterval("执行函数名",间隔时间); setInterval(fun,1000);每隔1秒钟执行一次fun函数 setInterval("f ...
- Ubuntu安装PHP时候出错--xml2-config not found
在Ubuntu下接着安装php时候,在configure后,又出现错误提示:error: xml2-config not found. Please check your libxml2 instal ...
- (中等) POJ 3280 Cheapest Palindrome,DP。
Description Keeping track of all the cows can be a tricky task so Farmer John has installed a system ...
- pom文件说明
http://www.blogjava.net/hellxoul/archive/2013/05/16/399345.html
- 170113、CentOs6.4中安装和配置vsftp简明教程
一.vsftp安装篇 代码如下: # 安装vsftpdyum -y install vsftpd# 启动service vsftpd start# 开启启动chkconfig vsftpd on 二. ...