摘要:
给定一个长度为n 的整数序列,请找出最长的不包含重复的数的连续区间长度。 #include <iostream> #include <unordered_map> using namespace std; const int N = 100010; int a[N]; unordered_map<i 阅读全文
posted @ 2022-11-30 21:15
!&&||
阅读(29)
评论(0)
推荐(0)
摘要:
输入一个 n 行 m 列的整数矩阵,再输入 q 个操作,每个操作包含五个整数 x1,y1,x2,y2,c,其中 (x1,y1) 和 (x2,y2)表示一个子矩阵的左上角坐标和右下角坐标。 每个操作都要将选中的子矩阵中的每个元素的值加上 c。 请你将进行完所有操作后的矩阵输出。 #include <i 阅读全文
posted @ 2022-11-30 21:12
!&&||
阅读(34)
评论(0)
推荐(0)
摘要:
输入一个长度为 n 的整数序列。 接下来输入 m 个操作,每个操作包含三个整数 l,r,c,表示将序列中 [l,r] 之间的每个数加上 c。 请你输出进行完所有操作后的序列。 #include <iostream> using namespace std; const int N = 100010; 阅读全文
posted @ 2022-11-30 21:11
!&&||
阅读(68)
评论(0)
推荐(0)
摘要:
输入一个 n行 m 列的整数矩阵,再输入 q 个询问,每个询问包含四个整数 x1,y1,x2,y2x1,y1,x2,y2,表示一个子矩阵的左上角坐标和右下角坐标。 输出子矩阵中所有数的和。 #include <iostream> #include <cstdio> using namespace s 阅读全文
posted @ 2022-11-30 21:10
!&&||
阅读(36)
评论(0)
推荐(0)
摘要:
输入一个长度为 n 的整数序列。 每个询问输入一对 {s,e};对于每个询问,输出原序列中从第 s个数到第 e个数的和。 #include <iostream> #include <cstdio> using namespace std; const int N = 100010; int n, m 阅读全文
posted @ 2022-11-30 20:51
!&&||
阅读(59)
评论(0)
推荐(0)
摘要:
给定两个非负整数,请你计算 它们 的商和余数。 #include <iostream> #include <vector> #include <algorithm> using namespace std; vector<int> a, c; int b; int div () { int t = 阅读全文
posted @ 2022-11-30 20:50
!&&||
阅读(42)
评论(0)
推荐(0)
摘要:
给定两个非负整数,请你计算它们的值。 #include <iostream> #include <vector> using namespace std; vector<int> a, b, c; void mul () { int m = a.size(), n = b.size(); c = v 阅读全文
posted @ 2022-11-30 20:45
!&&||
阅读(33)
评论(0)
推荐(0)
摘要:
给定两个正整数,计算它们的差。 #include <iostream> #include <vector> using namespace std; vector<int> a, b, c; bool cmp () { if (a.size() != b.size()) return a.size( 阅读全文
posted @ 2022-11-30 20:42
!&&||
阅读(42)
评论(0)
推荐(0)
摘要:
给定两个正整数(可能很大,超过long long 长度 #include <iostream> #include <vector> using namespace std; vector<int> a, b, c; void add () { int t = 0; for (int i = 0; i 阅读全文
posted @ 2022-11-30 20:41
!&&||
阅读(46)
评论(0)
推荐(0)
摘要:
求浮点数 n的三次方根 #include <iostream> using namespace std; double n; double BF (double x) { double l = -100, r = 100; while (r - l > 1e-8) { double mid = (l 阅读全文
posted @ 2022-11-30 20:38
!&&||
阅读(179)
评论(0)
推荐(0)

浙公网安备 33010602011771号