当前位置:网站首页>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;
}
边栏推荐
- App new function launch
- Fastjson反序列化随机性失败
- Oracle -- table operation
- 万亿热钱砸向太空经济,真的是一门好生意?
- Multi modal data can also be Mae? Berkeley & Google proposed m3ae to conduct Mae on image and text data! The optimal masking rate can reach 75%, significantly higher than 15% of Bert
- Common MySQL database functions and queries
- App test points
- Oracle - getting started
- 2022年河南省第一届职业技能大赛网络安全项目试题
- 最近准备翻译外国优质文章
猜你喜欢

Es7/es9 -- new features and regularities

电路模块分析练习5(电源)

QT learning setting executable exe attribute (solving the problem of Chinese attribute garbled)

ES6 - numerical extension and object extension

2022-2028 global industrial touch screen industry research and trend analysis report
![Intimacy - [comfortable exit] - final communication to reduce injury](/img/ab/c02d3b4213e1706e379d26073cbf07.jpg)
Intimacy - [comfortable exit] - final communication to reduce injury

荣耀推出积分商城,支持兑换各种荣耀产品

Network security project questions of the first Henan vocational skills competition in 2022
[email protected]@COLLATION_CONNECTION */"/>.sql数据库导入错误:/*!40101 SET @[email protected]@COLLATION_CONNECTION */

为什么OpenCV计算的帧率是错误的?
随机推荐
Relinearization in homomorphic encryption (ckks)
Actual combat: how to quickly change font color in typera (blog sharing - perfect) -2022.6.25 (solved)
What do l and R of earphone mean?
oracle -- 表操作
App new function launch
2022-2028 global cloud based remote browser isolation industry research and trend analysis report
Glory launched the points mall to support the exchange of various glory products
As a programmer, how can we learn, grow and progress happily? (personal perception has nothing to do with technology)
Initialization process of gstlibav
百度:2022年十大热度攀升专业出炉,第一名无悬念!
ES6-Const常量与数组解构
1281_FreeRTOS_vTaskDelayUntil实现分析
The wisdom of questioning? How to ask questions?
ES6 learning -- let
Another breakthrough! Alibaba cloud enters the Gartner cloud AI developer service Challenger quadrant
记|一次exists关键字的学习记录
C language and the creation and use of database
关闭MongoDB一些服务需要注意的地方(以及开启的相关命令)
zabbix_server配置文件详解
2022-2028 global transmission type photoelectric circuit breaker industry research and trend analysis report