首页 > 铺地毯
头像 Ldh1315109
发表于 2025-11-07 16:55:37
def solve(testcase): n = II() res = -1 A = [] for _ in range(n): a, b, g, k = MI() A.append((a, b, g, k)) x 展开全文
头像 _name
发表于 2025-12-26 20:08:43
#include <vector> #include <iostream> using namespace std; /* 先把所有地毯的坐标储存起来 因为后面的地毯覆盖在前面的地毯上 所以,如果有多个包含点(x,y)的地毯,就输出最后一个 也就是反向遍历 如果符合条件,就退 展开全文
头像 Hauauah
发表于 2026-04-20 17:43:54
解题思路因为地毯是按编号从小到大依次铺设的,后铺的会盖住先铺的。我们要找的是覆盖点 (o, p) 的最上面那张地毯,也就是编号最大的那张。解题步骤读入 n,然后读入每张地毯的参数 (a, b, x, y),其中 (a, b) 是左下角,x 和 y 分别是沿 x 轴和 y 轴的长度。读入目标点 (o, 展开全文
头像 哈基图
发表于 2026-01-26 18:32:46
#include<bits/stdc++.h> using namespace std; bool cover(int x,int y,vector<int>pos){ int ldx = pos[0], ldy = pos[1]; int rux = ldx 展开全文
头像 无聊的劳伦斯在做测评
发表于 2026-03-26 12:33:29
#include <stdio.h> int main() { int n = 0; scanf("%d", &n); int arr[n][4]; for (int i = 0; i < n; i++) { for (int j = 0; 展开全文
头像 金刚侠
发表于 2026-04-23 12:35:43
#include <iostream> using namespace std; struct tanzi{//一开始想要直接用二维数组存编号,但还是超内存了 int a,b,c,d; }; int main(){ int n,a,b,c,d; cin>&g 展开全文
头像 Sk1Em6er
发表于 2025-12-07 21:18:06
#include <stdio.h> //利用结构体解决 typedef struct { int a, b, g, k; } Carpet; int main() { int n; scanf("%d", &n); 展开全文
头像 小white君
发表于 2026-01-27 22:14:01
#include <iostream> using namespace std; int main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); std::cout.tie(nullpt 展开全文
头像 沧浪之歌
发表于 2026-04-20 12:27:02
#include <stdio.h> int main() { int n, x, y; scanf("%d\n", &n); int carpet[n][4]; for (int i = 0; i < n; ++i) 展开全文
头像 星璇Xx
发表于 2025-11-16 19:12:48
#include<bits/stdc++.h> using namespace std; const int N = 1e4 + 10; struct pet{ //地毯结构体 int a,b,g,k; }p[N]; int main(){ int n; cin >> 展开全文

等你来战

查看全部