結果

問題 No.3018 簡易版ページランク
ユーザー cielciel
提出日時 2017-03-18 01:18:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 19 ms / 2,000 ms
コード長 455 bytes
コンパイル時間 672 ms
コンパイル使用メモリ 67,788 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 19:34:31
合計ジャッジ時間 1,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <vector>
#include <map>
#include <cstdio>
using namespace std;

int main(){
	int N,M,a,b,c;
	scanf("%d%d",&N,&M);
	vector<int>total(N);
	map<int,map<int,int> >x;
	for(int i=0;i<M;i++){
		scanf("%d%d%d",&a,&b,&c);
		total[a]+=c;
		x[a][b]=c;
	}
	vector<double>r(N,10);
	for(int c=0;c<100;c++){
		vector<double>r0(N);
		for(int i=0;i<N;i++){
			for(auto &e:x[i])r0[e.first]+=r[i]*e.second/total[i];
		}
		r=r0;
	}
	for(auto &e:r)printf("%f\n",e);
}
0