結果

問題 No.298 話の伝達
ユーザー yukiyuki
提出日時 2015-11-14 02:49:18
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 771 bytes
コンパイル時間 1,238 ms
コンパイル使用メモリ 145,964 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-11 17:39:42
合計ジャッジ時間 2,024 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,352 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 2 ms
4,356 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define FOR(i,a,b)    for (int i=(a)  ;i<(b) ;i++)
#define RFOR(i,a,b)   for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)      for (int i=0    ;i<(n) ;i++)
#define RREP(i,n)     for (int i=(n)-1;i>=0  ;i--)
#define ALL(a)        (a).begin(),  (a).end()
#define RALL(a)       (a).rbegin(), (a).rend()

const int MOD = 1e9 + 7;
const int INF = 1 << 29;
const double EPS = 1e-10;

using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int n,m;
  cin >> n >> m;
  vector<float> p(n,1.0);

  p[0] = 0.0;

  REP(i,m){
    int a,b,c;
    cin >> a >> b >> c;
    p[b] *= 1.0 - (1.0 - p[a])*(c / 100.0);
    //cout << p[b] << endl;
  }

  REP(i,n){
    //cout << p[i] << endl;
  }

  cout << (1.0 - p[n-1]) << endl;

  return 0;
}
0