当前位置:网站首页>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;
}
边栏推荐
- GStreamer initialization and plugin registry procedures
- Wpewebkit debugging MSE playback
- Jz-064- maximum value of sliding window
- 22 years of a doctor in Huawei
- How to disable the optical drive
- pdm导入vscode的实现方式
- 【ModuleBuilder】GP服务实现SDE中两个图层相交选取
- 建立自己的网站(15)
- Unity技术手册 - 生命周期旋转RotationOverLifetime-速度旋转RotationBySpeed-及外力
- 1281_ FreeRTOS_ Implementation analysis of vtaskdelayuntil
猜你喜欢

How to solve the problem of SQL?

干货丨产品的可行性分析要从哪几个方面入手?

Glory launched the points mall to support the exchange of various glory products

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

【EOSIO】EOS/WAX签名错误 is_canonical( c ): signature is not canonical 问题

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

Canoe: the fifth simulation project: simulation + test

Relinearization in homomorphic encryption (ckks)

2022-2028 global carbon fiber unidirectional tape industry research and trend analysis report

一位博士在华为的22年
随机推荐
Global and Chinese flame retardant ABS industry development trend and market demand analysis report 2022 ~ 2028
ES7/ES9 -- 新特性与正则
oracle -- 表操作
Some points to pay attention to when closing mongodb services (as well as related commands when opening)
2022-2028 global industrial touch screen industry research and trend analysis report
C language and the creation and use of database
元宇宙标准论坛成立
pdm的皮毛
再突破!阿里云进入Gartner云AI开发者服务挑战者象限
2022-2028 global web and browser isolation platform industry research and trend analysis report
The applet draws a simple pie chart
万亿热钱砸向太空经济,真的是一门好生意?
How to use JMeter for interface testing
Unity的Ping類使用
Unity的Ping类使用
2022-2028 global co extrusion production line industry research and trend analysis report
腾讯《和平精英》新版本将至:新增账号安全保护系统,游戏内违规行为检测升级
Es6-- set
Does jQuery cache any selectors- Does jQuery do any kind of caching of “selectors”?
ES6-Const常量与数组解构