結果
問題 |
No.8018 簡易版ページランク
|
ユーザー |
|
提出日時 | 2020-03-09 09:08:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 796 ms |
コンパイル使用メモリ | 76,672 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 20:52:00 |
合計ジャッジ時間 | 1,873 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
main.cpp:9:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 9 | main() | ^~~~
ソースコード
#include<iostream> #include<vector> #include<iomanip> using namespace std; double A[101][1000]; vector<pair<int,int> >G[1000]; double sum[1000]; int N,M; main() { cin>>N>>M; for(int i=0;i<M;i++) { int a,b,c;cin>>a>>b>>c; G[a].push_back(make_pair(b,c)); sum[a]+=c; } for(int i=0;i<N;i++)A[0][i]=10; for(int t=0;t<100;t++) { for(int i=0;i<N;i++) { for(pair<int,int>p:G[i]) { A[t+1][p.first]+=A[t][i]*p.second/sum[i]; } } } for(int i=0;i<N;i++)cout<<fixed<<setprecision(16)<<A[100][i]<<endl; }