比赛 NOIP模拟赛by mzx Day2 评测结果 RRRRRRRRRR
题目名称 学姐的巧克力盒 最终得分 0
用户昵称 supersu 运行时间 0.026 s
代码语言 C++ 内存使用 1.84 MiB
提交时间 2016-10-20 20:12:28
显示代码纯文本
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<ctime>
using namespace std;
long long n;
long long squ[200000]={};
int main()
{
    freopen("three_squirrels.in","r",stdin);
    freopen("three_squirrels.out","w",stdout);
    cin>>n;
    if(n==0)    {cout<<1<<endl;exit(0);}
    squ[0]=1;
    for(long long i=1;i<=n;i++)
    {
        long long woo;
        cin>>woo;
        for(long long j=1;j<=woo;j++)
        {
            long long xx;
            cin>>xx;
            squ[i]=(squ[i]+squ[xx])%(1000000000+7);
        }
    }
    cout<<squ[n]<<endl;
	//cout<<"The time has passed:"<<clock()<<" ms"<<endl;
    return 0;
}