首页 > 小A的线段(easy version)
头像 银河护胃队
发表于 2026-02-22 10:03:31
#include<bits/stdc++.h> using namespace std; const int N=1e5+10,P=998244353; int n,m,res; vector<pair<int,int>> v; vector<int&g 展开全文
头像 阿彪b
发表于 2025-12-17 22:02:57
//递归遍历m个线段选或者不选的情况。 //使用1-n的差分数组记录每个点被几个线段覆盖 #include <bits/stdc++.h> using namespace std; int n,m,ans=0; vector<pair<int,int>> xd(1 展开全文
头像 冷艳的西红柿刷牛客
发表于 2025-10-27 12:12:23
#include <iostream> #include <vector> using namespace std; int line[10][2]; int n, m, ans; const int p = 998244353; bool judge(vector 展开全文
头像 丨阿伟丨
发表于 2025-08-29 12:02:13
题目链接 小A的线段(easy version) 题目描述 在坐标轴的整数点 上给出 条闭区间线段,第 条线段用其端点 描述。 现在要从这 条线段中选择若干条,使得每个整数点被至少两条所选线段覆盖。求满足条件的选择方案数量。 两种方案视为不同,当且仅当存在某条线段在两方案中的“选不选”状态 展开全文
头像 牛客754921490号
发表于 2025-12-22 15:01:58
#include <iostream> #include <istream> #include <ratio> #include <vector> #include <unordered_map> #include <algorith 展开全文
头像 greatofdream
发表于 2025-08-26 18:55:53
n, m = map(int, input().split()) edges = [list(map(int, input().split())) for _ in range(m)] boundary = [] for i, e in enumerate(edges): boundary 展开全文