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 无参数:查看当前所在目录 ...
随机推荐
- Fragment管理
Fragments 设计理念 在设计应用时特别是Android 应用 ,有众多的分辨率要去适应,而fragments 可以让你在屏幕不同的屏幕上动态管理UI.例如:通讯应用程序(QQ),用户列表可以在 ...
- Qt5:QSystemTrayIcon类实现程序托盘图标
windows下,在许多应用程序中都会实现一个托盘图标,用于隐藏应用程序窗口时还能对该应用程序进行简单的操作,例如 QQ ,renren等程序 那么,在Qt中,如何实现呢? 这就要用到Qt提供的 QS ...
- 修炼dp(1)
从最简单的开始: POJ:The Triangle #include <cstdio> #include <algorithm> #include <cstring> ...
- JAVA基础---面向对象
方法的重载Overload: 一个类中可以定义有相同的名字, 参数不同的多个方法. 调用时, 会根据不同的参数选择对应的方法. static: 在数据区, 可以计数,属于类,不属于对象: public ...
- html中DIv并排显示问题
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD ...
- iOS之UILabel自适应大小
//初始化一个label self.label=[[UILabel alloc] init]; //设置自动行数与字符换行 [self.label setNumberOfLines:0]; //给la ...
- php 设计模式系列(一)
参考文章:http://duchengjiu.iteye.com/blog/2227452 多态代码 // 多态, 在JAVA中是这样用的, 其实在PHP当中可以自然消除, 因为参数是动态的, 你传什 ...
- 漂亮的HTML表格 - ebirdfighter的日志 - 网易博客
一个像素边框的表格: Info Header 1 Info Header 2 Info Header 3 Text 1A Text 1B Text 1C Text 2A Text 2B Text 2C ...
- OpenStack - liberty CentOS 7
OpenStack私有云部署 Controller Node: em1(10.6.17.11),em2() Computer Node: em1(10.6.17.12),e ...
- 获取手机wifi下的网络地址
#import "getIPhoneIP.h" #import <ifaddrs.h> #import <arpa/inet.h> @implementat ...