相关文章
判断两个矩形是否相交(Rect Intersection)
0x00 Preface
最近在开发一个2D组态图形组件的过程中,里面的数学模块,涉及到两个矩形是否相交的判断。
这个问题很多年前就写过,算是个小的算法吧。
网络上搜索一下,有很多思路,有一些思路要基于多种组合的判断&…
建站知识
2025/2/8 12:53:51
LOJ#6280. 数列分块入门 4
内存限制:256 MiB时间限制:500 ms标准输入输出 题目类型:传统评测方式:文本比较 上传者: hzwer 提交 提交记录 统计 讨论 测试数据 题目描述 给出一个长为 nnn 的数列,以及 nnn 个操作,操作涉及…
建站知识
2025/2/8 12:54:34
LOJ #6280. 数列分块入门 4
题目链接:传送门
区间加法,区间求和
每个块再维护一个sum数组 修改的时候看着改就行了 细节细节
/*** Date: 2019-03-16T20:22:5008:00* Last modified time: 2019-03-16T20:22:5208:00*/
#include <iostream>
#include <cstdio>
#incl…
建站知识
2025/2/8 12:54:44
【loj6280】数列分块练习 4
「分块」数列分块入门1 – 9 by hzwer
#include<iostream>
#include<fstream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#define inf 0x3f3f3f3f
#defi…
建站知识
2025/2/8 12:53:29
hdu6280 From Tree to Graph
From Tree to Graph
Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 327680/327680 K (Java/Others)Total Submission(s): 23 Accepted Submission(s): 8 Problem Description Bobo has a tree of n vertices numbered with 0,1,…,(n−1). He subsequently …
建站知识
2025/2/8 13:01:22
数列分块入门 4(LibreOj-6280)
【题目描述】 给出一个长为 n 的数列,以及 n 个操作,操作涉及区间加法,区间求和。 【输入格式】 第一行输入一个数字 n。 第二行输入 n 个数字,第 i 个数字为 ai,以空格隔开。 接下来输入 n 行询问,每行输入…
建站知识
2025/3/20 17:04:47
LOJ - #6280. 数列分块入门 4
题目链接:https://loj.ac/problem/6280
#include<bits/stdc.h>
#define ll long long
using namespace std;
const int maxn 5e4 5;
int blo, n, opt, l, r, c, pos[maxn];
ll atag[maxn], sum[maxn], a[maxn];
int add(int l, int r, int c)
{for (int i …
建站知识
2025/2/8 12:54:36
#6280. 数列分块入门 4
#6280. 数列分块入门 4
内存限制:256 MiB时间限制:500 ms标准输入输出
题目描述 给出一个长为 n 的数列,以及 n 个操作,操作涉及区间加法,区间求和。 输入格式 第一行输入一个数字 n。 第二行输入 n 个数字ÿ…
建站知识
2025/2/8 12:56:05