摘要:
二维前缀和模板 题目描述: 输入一个 n 行 m 列的整数矩阵,再输入 q个询问,每个询问包含四个整数 x1,y1,x2,y2,表示一个子矩阵的左上角坐标和右下角坐标。 对于每个询问输出子矩阵中所有数的和。 输入格式: 第一行包含三个整数 n,m,q 接下来 n 行,每行包含 m 个整数,表示整数矩 阅读全文
摘要:
一维前缀和模板 如下: #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int a[N],sum[N]; int n,m; int main() { cin>>n>>m; for(int i=1;i<=n;i++) 阅读全文
摘要:
#include <iostream> using namespace std; const int N=1e7+10; int a[N]; int n; bool isGoodNum(int x) { int count=0; while(x>0) { a[++count]=x%10; x=x/1 阅读全文