#include #define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i]; #define ft first #define sc second #define pb push_back #define lb lower_bound #define ub upper_bound #define all(v) (v).begin(),(v).end() #define LB(a,x) lb(all(a),x)-a.begin() #define UB(a,x) ub(all(a),x)-a.begin() #define mod 1000000007 #define FS fixed< using V=vector; using Graph = vector>; using P=pair; typedef unsigned long long ull; typedef long double ldouble; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } const ll INF=1e18; const int mx=305; ll dp[mx][mx][mx]; int main(){ cin.tie(0);ios::sync_with_stdio(false); int n,m,kk; cin>>n>>m>>kk; V p(m),q(m),c(m); rep(i,m)cin>>p[i]>>q[i]>>c[i]; map mp; rep(i,m)mp[make_pair(p[i],q[i])]=c[i]+1; //if(n%2==1)cout<<1<0){ dp[i+1][x][q[k]]=(dp[i+1][x][q[k]]+dp[i][j][p[k]])%mod; } } } } } ll ans=0; for(int i=0;i<=300;i++)ans=(ans+dp[n][kk][i])%mod; cout< a(m)でm==0というものはできない) modはなるべく最後に取れ! doubleを扱うときには(abs)ではなく'fabs'!!! */