Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- */
- //#pragma comment(linker, "/STACK:16777216")
- #include <fstream>
- #include <iostream>
- #include <string>
- #include <complex>
- #include <math.h>
- #include <set>
- #include <vector>
- #include <map>
- #include <queue>
- #include <stdio.h>
- #include <stack>
- #include <algorithm>
- #include <list>
- #include <ctime>
- //#include <memory.h>
- #define y0 sdkfaslhagaklsldk
- #define y1 aasdfasdfasdf
- #define yn askfhwqriuperikldjk
- #define j1 assdgsdgasghsf
- #define tm sdfjahlfasfh
- #define lr asgasgash
- #define eps 1e-14
- //#define M_PI 3.141592653589793
- #define bs 1000000009
- #define bsize 256
- //#define N 120000
- using namespace std;
- long n;
- double prob[201][201];
- double temp[201][201],temp1[201][201];
- void mult(double v[201][201], long n)
- {
- for (int i=0;i<n;i++)
- for (int j=0;j<n;j++)
- temp[i][j]=temp1[j][i]=v[i][j],v[i][j]=0;
- for (int i=0;i<n;i++)
- for (int j=0;j<n;j++)
- for (int k=0;k<n;k++)
- v[i][j]+=temp[i][k]*temp1[j][k];
- for (int i=0;i<n;i++)
- for (int j=0;j<n;j++)
- if (v[i][j]<1e-20)v[i][j]=0;
- }
- int main(){
- //freopen("magic.in","r",stdin);
- //freopen("magic.out","w",stdout);
- //freopen("C:/input.txt","r",stdin);
- //freopen("C:/output.txt","w",stdout);
- ios_base::sync_with_stdio(0);
- //cin.tie(0);
- n = 200;
- for (int i=0;i<n;i++)
- for (int j=0;j<n;j++)
- prob[i][j]=rand()%1000*0.001;
- for (int iter=1;iter<=8;iter++)
- mult(prob,n);
- cin.get();cin.get();
- return 0;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement