引用:https://blog.csdn.net/qq_41879343/article/details/100565031

下面代码写错了,注意要上面这种。查:2  800  0,下面代码就错了。

 #define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#include <cstdio>//sprintf islower isupper
#include <cstdlib>//malloc exit strcat itoa system("cls")
#include <iostream>//pair
#include <fstream>//freopen("C:\\Users\\13606\\Desktop\\草稿.txt","r",stdin);
#include <bitset>
//#include <map>
//#include<unordered_map>
#include <vector>
#include <stack>
#include <set>
#include <string.h>//strstr substr
#include <string>
#include <time.h>//srand(((unsigned)time(NULL))); Seed n=rand()%10 - 0~9;
#include <cmath>
#include <deque>
#include <queue>//priority_queue<int, vector<int>, greater<int> > q;//less
#include <vector>//emplace_back
//#include <math.h>
//#include <windows.h>//reverse(a,a+len);// ~ ! ~ ! floor
#include <algorithm>//sort + unique : sz=unique(b+1,b+n+1)-(b+1);+nth_element(first, nth, last, compare)
using namespace std;//next_permutation(a+1,a+1+n);//prev_permutation
#define fo(a,b,c) for(register int a=b;a<=c;++a)
#define fr(a,b,c) for(register int a=b;a>=c;--a)
#define mem(a,b) memset(a,b,sizeof(a))
#define pr printf
#define sc scanf
#define ls rt<<1
#define rs rt<<1|1
typedef long long ll;
void swapp(int &a,int &b);
double fabss(double a);
int maxx(int a,int b);
int minn(int a,int b);
int Del_bit_1(int n);
int lowbit(int n);
int abss(int a);
//const long long INF=(1LL<<60);
const double E=2.718281828;
const double PI=acos(-1.0);
const int inf=(<<);
const double ESP=1e-;
const int mod=(int)1e9+;
const int N=(int)1e6+; ll a[N];
ll ans[][]; int main()
{
int n;
sc("%d",&n);
fo(n_,,n)
{
int judge,x,y;
sc("%d%d%d",&judge,&x,&y);
if(judge==)
{
a[x]+=y;
for(int i=;i<=;++i)
ans[x%i][i]+=y;
}
else
{
ll Ans=;
if(x<=)
Ans+=ans[y][x];
else
for(int i=;i<=;i+=x)
Ans+=a[i+y-];
pr("%lld\n",Ans);
}
}
return ;
} /**************************************************************************************/ int maxx(int a,int b)
{
return a>b?a:b;
} void swapp(int &a,int &b)
{
a^=b^=a^=b;
} int lowbit(int n)
{
return n&(-n);
} int Del_bit_1(int n)
{
return n&(n-);
} int abss(int a)
{
return a>?a:-a;
} double fabss(double a)
{
return a>?a:-a;
} int minn(int a,int b)
{
return a<b?a:b;
}

最新文章

  1. asp.net 对数据库表增加,删除,编辑更新修改
  2. C#将科大讯飞语音合成文件转换为MULAW音频格式
  3. JavaScript SetInterval与setTimeout使用方法详解
  4. Python-层次聚类-Hierarchical clustering
  5. A Simple MVVM Example[Forward]
  6. javascript 如何访问 action或者controller 传给 jsp 页面的值
  7. ios 适应屏幕
  8. windows笔记-一个简单的windows GUI应用程序
  9. c++中构造函数 、析构函数的作用域详解
  10. 文件系统:介绍一个高大上的东西 - 零基础入门学习Python030
  11. Hibernate JPA中@Transient、@JsonIgnoreProperties、@JsonIgnore、@JsonFormat、@JsonSerialize等注解解释
  12. mysq Point类型 查询和插入操作:insert和select
  13. SpringMVC传参
  14. Confluence 6 代理和 HTTPS 详细配置指南链接
  15. JRebel 代理激活
  16. 最课程阶段大作业之01:使用SVN实现版本控制
  17. 20170712 SQL Server 日志文件收索
  18. 日期在Linux与Windows下的区别
  19. iOSUIWebView---快停下啦,你的愚蠢的行为
  20. 了解innodb_support_xa(分布式事务)

热门文章

  1. Java的消息机制
  2. ETL测试场景和测试用例设计
  3. 【java设计模式】-05建造者模式
  4. 【APUE】第3章 文件I/O (2) 函数creat、lseek、read、write使用说明
  5. java.util.Date和java.sql.Date的区别和相互转化 (转)
  6. Android input输入框 移动页面input手机键盘中的“搜索”按键
  7. Qt之CMake和MinGW编译OpenCV
  8. P1439 【模板】最长公共子序列 LCS
  9. 1.ibatis核心类
  10. 小D课堂 - 新版本微服务springcloud+Docker教程_5-01分布式核心知识之熔断、降级