博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu 4342 History repeat itself
阅读量:4344 次
发布时间:2019-06-07

本文共 546 字,大约阅读时间需要 1 分钟。

当出现和long long相关的操作时  一定要注意定义的int 变量在相加或相乘时是否会越界

#include
#include
#include
#include
#include
#include
#define LL long longusing namespace std;const int N=100005;LL asum[N];LL num[N];void bigen(){ asum[1]=1; num[1]=0; for(LL i=2;i
>T; while(T--) { LL n; cin>>n; LL m; for(int i=1;i
=n) { m=i-1; break; } } LL ans1=m*m+(n-num[m]); LL ans2=asum[m]+(n-num[m])*m; cout<
<<" "<
<

  

转载于:https://www.cnblogs.com/liulangye/archive/2012/08/08/2627902.html

你可能感兴趣的文章
“==”运算符与equals()
查看>>
单工、半双工和全双工的定义
查看>>
Hdu【线段树】基础题.cpp
查看>>
时钟系统
查看>>
BiTree
查看>>
5个基于HTML5的加载动画推荐
查看>>
水平权限漏洞的修复方案
查看>>
静态链接与动态链接的区别
查看>>
Android 关于悬浮窗权限的问题
查看>>
如何使用mysql
查看>>
linux下wc命令详解
查看>>
敏捷开发中软件测试团队的职责和产出是什么?
查看>>
在mvc3中使用ffmpeg对上传视频进行截图和转换格式
查看>>
python的字符串内建函数
查看>>
Spring - DI
查看>>
微软自己的官网介绍 SSL 参数相关
查看>>
Composite UI Application Block (CAB) 概念和术语
查看>>
ajax跨域,携带cookie
查看>>
阶段3 2.Spring_01.Spring框架简介_03.spring概述
查看>>
阶段3 2.Spring_02.程序间耦合_1 编写jdbc的工程代码用于分析程序的耦合
查看>>