結果

問題 No.1111 コード進行
ユーザー mfbgjsczmfbgjscz
提出日時 2020-07-10 22:19:54
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,820 bytes
コンパイル時間 2,391 ms
コンパイル使用メモリ 209,996 KB
実行使用メモリ 510,848 KB
最終ジャッジ日時 2024-04-19 17:32:10
合計ジャッジ時間 15,308 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 359 ms
510,720 KB
testcase_02 AC 356 ms
510,592 KB
testcase_03 WA -
testcase_04 AC 357 ms
510,720 KB
testcase_05 WA -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 376 ms
510,720 KB
testcase_18 RE -
testcase_19 AC 363 ms
510,720 KB
testcase_20 AC 367 ms
510,720 KB
testcase_21 RE -
testcase_22 AC 371 ms
510,848 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 AC 423 ms
510,720 KB
testcase_29 AC 406 ms
510,720 KB
testcase_30 RE -
testcase_31 WA -
testcase_32 RE -
testcase_33 RE -
testcase_34 AC 416 ms
510,592 KB
testcase_35 AC 431 ms
510,592 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 AC 428 ms
510,720 KB
testcase_42 RE -
testcase_43 RE -
testcase_44 RE -
testcase_45 RE -
testcase_46 WA -
testcase_47 AC 465 ms
510,720 KB
testcase_48 AC 450 ms
510,720 KB
testcase_49 AC 443 ms
510,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
*/#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")    
using namespace std;
/*namespace mp = boost::multiprecision;
using Bint = mp::cpp_int;
using Real = mp::number<mp::cpp_dec_float<1024>>;
*/#define lli long long int
#define uli unsigned long long int
#define INF 999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(50) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,S) vector<vector<L>> K(N,vector<L>(M,S))
#define TV(K,L,N,M,R,S) vector<vector<vector<L>>> K(N,vector<vector<L>>(M,vector<L>(R,S)))
#define pint pair<lli,lli>
#define paf(L,R) pair<L,R>
#define mod 1000000007
#define MAX 10000000
#define ALL(a)  a.begin(),a.end()
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
struct edge{
  int first;
  int second;
};
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  lli A,B,C,D,E,H,W,M,K,L,R,N,num=0,sum=0,flag=0;string S,T;
  cin >> N >> M >> K;
  vector<vector<edge>> P(N);
  rep(i,0,M){
    cin >> A >> B >> C;
    edge e;
    e.first=B-1;
    e.second=C;
    P[A-1].pb(e);
  }
  TV(dp,lli,400,400,400,0);
  rep(i,0,310)dp[0][i][0]=1;
  rep(i,1,N){
    rep(j,0,N)for(auto v:P[j])rep(k,0,K+10)if(k+v.second<350)dp[i][v.first][k+v.second]=dp[i-1][j][k];
    rep(j,0,400)rep(k,0,400)dp[i][j][k]%=mod;
  }
  rep(i,0,N)sum+=dp[N-1][i][K];
  Out(sum%mod);
}
0