当前位置:网站首页>The sum of logarithms in group 52--e of Niuke Xiaobai monthly race (two points)
The sum of logarithms in group 52--e of Niuke Xiaobai monthly race (two points)
2022-06-25 23:10:00 【Rong AI holiday】
Niuke Xiaobai moon race 52
E Sum logarithms in groups
Topic ideas
Ideas : Find two numbers greater than... From all the numbers k The number of schemes minus two numbers found from one person is greater than k Is the answer
Title code
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
const int N=1e6+10;
const ll INF=2000000000;
const int mod=998244353;
int n,k;
vector<int> g[N],h;
int cal(vector<int>&s){
sort(s.begin(),s.end());
int ans=0;
for(int i=0;i<s.size();i++){
int res=lower_bound(s.begin()+i+1,s.end(),k-s[i])-s.begin();
res=s.size()-res+1;
ans+=res;
ans%=mod;
}
return ans;
}
int main(){
cin>>n>>k;
for(int i=1;i<=n;i++){
int s;
cin>>s;
for(int j=1;j<=s;j++){
int x;
cin>>x;
g[i].push_back(x);
h.push_back(x);
}
}
int ans=0;
ans=cal(h);
for(int i=1;i<=n;i++){
ans=(ans-cal(g[i])+mod)%mod;
}
cout<<ans;
return 0;
}
边栏推荐
- ES6 -- formal parameter setting initial value, extension operator, iterator, and generating function
- 万亿热钱砸向太空经济,真的是一门好生意?
- Does jQuery cache any selectors- Does jQuery do any kind of caching of “selectors”?
- ES6 -- 形参设置初始值、拓展运算符、迭代器、生成函数
- 哪些PHP开源作品值得关注
- MySQL数据库索引
- Some reflections on preparing for the Blue Bridge Cup
- 剑指 Offer 46. 把数字翻译成字符串(DP)
- Oracle - 基本入门
- MySQL数据库常用函数和查询
猜你喜欢

ES6 learning -- let

The applet draws a simple pie chart

多台云服务器的 Kubernetes 集群搭建

1281_ FreeRTOS_ Implementation analysis of vtaskdelayuntil

2022-2028 global TFT LCD touch screen industry research and trend analysis report

27 Chinese scholars including Yaoban and chendanqi from Tsinghua won the awards, and the list of winners of Sloan award in 2022 was issued

为什么OpenCV计算的帧率是错误的?

oracle -- 表操作

哪些PHP开源作品值得关注

Privatization lightweight continuous integration deployment scheme -- 03 deployment of Web services (Part 2)
随机推荐
How do I project points on a 3D plane- How to project a point onto a plane in 3D?
APP测试要点
Equivalence class, boundary value, application method and application scenario of scenario method
作为一个程序员我们如何快乐的学习成长进步呢?(个人感悟和技术无关)
Lecture 14 of the Blue Bridge Cup -- number theory [example]
Why is BeanUtils not recommended?
Record the learning record of the exists keyword once
记|一次exists关键字的学习记录
2022-2028 global variable frequency compressor technology industry research and trend analysis report
Use apiccloud AVM multi terminal component to quickly realize the search function in the app
电路模块分析练习5(电源)
Thinking while walking
QT learning setting executable exe attribute (solving the problem of Chinese attribute garbled)
最近准备翻译外国优质文章
Analysis report on demand and investment forecast of global and Chinese flame retardant hydraulic oil market from 2022 to 2028
C language and the creation and use of database
再突破!阿里云进入Gartner云AI开发者服务挑战者象限
ADB common commands
ORACLE - 数据查询
Wpewebkit debugging MSE playback