当前位置:网站首页>Somme logarithmique (deux points) pour le Groupe 52 - - e de la course de la lune blanche de niuke
Somme logarithmique (deux points) pour le Groupe 52 - - e de la course de la lune blanche de niuke
2022-06-25 23:10:00 【Rong ai Fei】
Niuke Xiaobai Yue race52
E Somme logarithmique des groupes
Sujet pensée
Idées:Deux de tous les nombres sont plus grands quekLe nombre de schémas soustrayant deux nombres trouvés d'une personne est plus grand quekLa solution est
Code du sujet
#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;
}
边栏推荐
- 2022-2028 global transmission type photoelectric circuit breaker industry research and trend analysis report
- Which PHP open source works deserve attention
- APP测试要点
- 2022-2028 global industrial TFT LCD industry survey and trend analysis report
- Flex & Bison 开始
- How do I project points on a 3D plane- How to project a point onto a plane in 3D?
- adb常用命令
- MySQL数据库索引
- ES6 - numerical extension and object extension
- 字符串变形(字符串大小写切换和变现)
猜你喜欢

2022-2028 global variable frequency compressor technology industry research and trend analysis report

2022-2028 global open source cloud storage industry research and trend analysis report

万亿热钱砸向太空经济,真的是一门好生意?

2022-2028 global RBI platform industry research and trend analysis report

Basic concepts of processor scheduling

Why absolute positioning overlaps
This 110 year old "longevity" enterprise has been planning for the next century

ES6-Const常量与数组解构

使用EAST ocr遇到的坑解决方法(编译lanms)

2022-2028 global extrusion coating and lamination production line industry research and trend analysis report
随机推荐
Fastjson deserialization randomness failed
Another breakthrough! Alibaba cloud enters the Gartner cloud AI developer service Challenger quadrant
Why is BeanUtils not recommended?
String deformation (string case switching and realization)
Unity technical manual - particle foundation main module attributes - upper
Analysis report on market business model and development direction of China mobile operation industry from 2022 to 2028
Intimacy - [comfortable exit] - final communication to reduce injury
Jz-064- maximum value of sliding window
Use of local stack in flask
LM小型可编程控制器软件(基于CoDeSys)笔记十七:pto脉冲功能块
Analysis report on demand and investment forecast of global and Chinese flame retardant hydraulic oil market from 2022 to 2028
2022-2028 global DC linear variable differential transformer (LVDT) industry survey and trend analysis report
2022-2028 global open source cloud storage industry research and trend analysis report
剑指 Offer 46. 把数字翻译成字符串(DP)
2022年中职组网络安全新赛题
Global and Chinese flame retardant ABS industry development trend and market demand analysis report 2022 ~ 2028
Glory launched the points mall to support the exchange of various glory products
2022-2028 global selective laser sintering service industry research and trend analysis report
QT learning setting executable exe attribute (solving the problem of Chinese attribute garbled)
电路模块分析练习5(电源)