0_0_29473632_19413.cpp:1:1122: fatal error: GCC4.9.2/x86_64-w64-mingw32/include/c++/bits/stdc++.h>usin: Invalid argument
#include <bits/stdc++.h>using namespace std;typedef long long LL;const LL INF=1e18;const int N=1e2+10; LL f[20][N][N],g[2][N];int n,L; int main(){ int T; scanf("%d",&T); while(T--) { scanf("%d%d",&n,&L); for(int i=0;i<n;i++) for(int j=0;j<n;j++) scanf("%lld",&f[0][i][j]); --L; int lev=0; for(int i=0;(1<<(i+1))<=L;i++) { for(int j=0;j<n;j++) for(int k=0;k<n;k++) { f[i+1][j][k]=-INF; for(int x=0;x<n;++x) f[i+1][j][k]=max(f[i][j][x]+f[i][x][k],f[i+1][j][k]); } ++lev; } int cur=0; fill(g[cur],g[cur]+n,0); for(int i=lev;i>=0;--i) { if(L<(1<<i)) continue; L-=(1<<i); cur=1-cur; fill(g[cur],g[cur]+n,-INF); for(int j=0;j<n;j++) for(int k=0;k<n;k++) g[cur][k]=max(g[1-cur][j]+f[i][j][k],g[cur][k]); } printf("%lld\n",*max_element(g[cur],g[cur]+n)); } return 0;}
^
compilation terminated.
|