cf 757C. Felicity is Coming!
这个题还是比较劲的(题意太神了),才知道vector还可以==和排序,扒题解大法好!!
#include<bits/stdc++.h>
#define lowbit(x) x&(-x)
#define LL long long
#define N 200005
#define M 1000005
#define mod 1000000007LL
#define inf 0x7ffffffff
using namespace std;
inline int ra()
{
int x=,f=; char ch=getchar();
while (ch<'' || ch>''){if (ch=='-') f=-; ch=getchar();}
while (ch>='' && ch<=''){x=x*+ch-''; ch=getchar();}
return x*f;
}
vector<int> a[M];
int main()
{
int n=ra(),m=ra();
for (int i=; i<=n; i++)
{
int num=ra();
while (num--)
{
int x=ra();
a[x].push_back(i);
}
}
sort(a+,a+m+);
LL ans=,f=;
for (int i=; i<=m; i++)
if (a[i]==a[i-])
{
f++;
ans=(ans*f)%mod;
}
else f=;
cout<<ans;
return ;
}
cf 757C. Felicity is Coming!的更多相关文章
- Codeforces 757C. Felicity is Coming!
C. Felicity is Coming! time limit per test:2 seconds memory limit per test:256 megabytes input:stand ...
- 【codeforces 757C】Felicity is Coming!
time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard o ...
- ORA-00494: enqueue [CF] held for too long (more than 900 seconds) by 'inst 1, osid 5166'
凌晨收到同事电话,反馈应用程序访问Oracle数据库时报错,当时现场现象确认: 1. 应用程序访问不了数据库,使用SQL Developer测试发现访问不了数据库.报ORA-12570 TNS:pac ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- cf Round 613
A.Peter and Snow Blower(计算几何) 给定一个点和一个多边形,求出这个多边形绕这个点旋转一圈后形成的面积.保证这个点不在多边形内. 画个图能明白 这个图形是一个圆环,那么就是这个 ...
- ARC下OC对象和CF对象之间的桥接(bridge)
在开发iOS应用程序时我们有时会用到Core Foundation对象简称CF,例如Core Graphics.Core Text,并且我们可能需要将CF对象和OC对象进行互相转化,我们知道,ARC环 ...
- [Recommendation System] 推荐系统之协同过滤(CF)算法详解和实现
1 集体智慧和协同过滤 1.1 什么是集体智慧(社会计算)? 集体智慧 (Collective Intelligence) 并不是 Web2.0 时代特有的,只是在 Web2.0 时代,大家在 Web ...
- CF memsql Start[c]UP 2.0 A
CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 m ...
- CF memsql Start[c]UP 2.0 B
CF memsql Start[c]UP 2.0 B B. Distributed Join time limit per test 1 second memory limit per test 25 ...
随机推荐
- 单元测试报错:unable to find a @SpringBootConfiguration
完整异常: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBoo ...
- YII insert multiple records into a table
$values = array(array(1,2),array(3,4),array(5,6),); $nbValues = count($values); $sql = 'INSERT INTO ...
- 114、Java中String类之字符串文本复杂二次拆分
01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...
- 在Windows中实现Java调用DLL(转载)
本文提供调用本地 C 代码的 Java 代码示例,包括传递和返回某些常用的数据类型.本地方法包含在特定于平台的可执行文件中.就本文中的示例而言,本地方法包含在 Windows 32 位动态链接库 (D ...
- PHP 获取一周的时间
$date = array( 'Monday' => array(date('Y-m-d H:i:s',strtotime("Monday")),date('Y-m-d H: ...
- map的查询和修改方法
1:map查询的方法 package com.cn.util; import java.util.ArrayList; import java.util.HashMap; import java.ut ...
- 41和为S的连续正数序列+注意循环条件记一下这题特殊解法
题目描述 小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100.但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数).没多久,他 ...
- 7.3 Varnish VCL 常用函数
- java中二进制反码补码的理解
7句真言 1,二进制最高位是符号位 0正数 1负数 2,正数的原码,反码,补码都一样 3负数的原码反码 补码 (符号位不变,其他的位数取反 0->1 1->0) 4 0的反码补码都是0 5 ...
- SciPy 介绍
章节 SciPy 介绍 SciPy 安装 SciPy 基础功能 SciPy 特殊函数 SciPy k均值聚类 SciPy 常量 SciPy fftpack(傅里叶变换) SciPy 积分 SciPy ...