当前位置:网站首页>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;
}
边栏推荐
- 使用EAST ocr遇到的坑解决方法(编译lanms)
- 2. What is the geometric meaning of a vector multiplying its transpose?
- Unity技术手册 - 粒子基础主模块属性-上
- oracle -- 表操作
- Fastjson deserialization randomness failed
- Unity technical manual - color in life cycle coloroverlifetime-- speed color colorbyspeed
- 2022-2028 global DC linear variable differential transformer (LVDT) industry survey and trend analysis report
- Canoe: the fifth simulation project: simulation + test
- Oracle - 基本入门
- Use apiccloud AVM multi terminal component to quickly realize the search function in the app
猜你喜欢

ES7/ES9 -- 新特性与正则

Canoe: the fifth simulation project: simulation + test

Es7/es9 -- new features and regularities

ES6 -- formal parameter setting initial value, extension operator, iterator, and generating function

ES6 learning -- let

ES6-- 模板字符串、对象的简化写法、箭头函数

腾讯《和平精英》新版本将至:新增账号安全保护系统,游戏内违规行为检测升级

民航局:到 2025 年我国将初步建成安全、智慧、高效和绿色的航空物流体系

2022-2028 global horizontal reciprocating compressor industry research and trend analysis report
2. What is the geometric meaning of a vector multiplying its transpose?
随机推荐
多台云服务器的 Kubernetes 集群搭建
2022-2028 global vacuum jacket system industry survey and trend analysis report
zabbix_ Server configuration file details
Privatization lightweight continuous integration deployment scheme -- 03 deployment of Web services (Part 2)
Which PHP open source works deserve attention
2022-2028 global variable frequency compressor technology industry research and trend analysis report
Relinearization in homomorphic encryption (ckks)
[eosio] eos/wax signature error is_ Canonical (c): signature is not canonical
小程序-视图与逻辑
adb常用命令
.sql数据库导入错误:/*!40101 SET @[email protected]@COLLATION_CONNECTION */
New network security competition of the secondary vocational group in 2022
2022-2028 global TFT LCD touch screen industry research and trend analysis report
建立自己的网站(15)
Some points to pay attention to when closing mongodb services (as well as related commands when opening)
一位博士在华为的22年
ES6-- 集合
MySQL数据库索引
How to design a complex business system? From the understanding of domain design, cloud native, micro service, and middle platform
The wisdom of questioning? How to ask questions?