#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define debug(x) cerr << #x << " = " << (x) << endl; #define mod 1000000007 //1e9+7(prime number) #define INF 1000000000 //1e9 #define LLINF 2000000000000000000LL //2e18 #define SIZE 100010 /* TopologicalSort */ vector TopologicalSort(vector > G,int n= -1){ if(n==-1) n=(int)G.size(); int u; vector ret,ret2; queue que; vector indeg(n+1,0); for(int i=0;i > vec(n, vector()); for(int i=0;i " << j << endl; vec[i].push_back(j); } } } auto res = TopologicalSort(vec); int dp[SIZE] = {}; int ans = 1; for(int i=0;i