Language: C

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#define DBLE 1e-8
#define PI 3.1415926535898
#define MAXN (1<<8)
#define INF 500000000
using namespace std;
int dp[55][MAXN][MAXN];
bool visit[55][MAXN][MAXN];
int ma[MAXN][MAXN];
struct _node
{
    int have,is,fi,ti;
};
_node node[55];
inline int mul(int a,int b,int c)
{
    return a*MAXN*MAXN+b*MAXN+c;
}
inline int gotn(int n,int &a,int &b,int &c)
{
    a=n/MAXN/MAXN;
    b=n/MAXN%MAXN;
    c=n%MAXN;
    return true;
}
int SPFA(int n)
{
    int a,b,c;
    queue<int> que;
    que.push(mul(1,0,0));
    while(que.empty()!=1)
    {
        gotn(que.front(),a,b,c);
        que.pop();
        visit[a][b][c]=0;
        for(int i=1;i<=n;++i)
        {
            int nb=b|node[a].have,nc=c;
            if(dp[a][b][c]+ma[a][i]<dp[i][nb][nc])
            {
                dp[i][nb][nc]=dp[a][b][c]+ma[a][i];
                if(visit[i][nb][nc]==0)
                    visit[i][nb][nc]=1,que.push(mul(a,nb,nc));
            }
            if(node[i].is>=0)
            {
                int dtime;
                nc=nc|(1<<node[i].is);
                if(b&(1<<node[i].is))   dtime=node[i].fi;
                else    dtime=node[i].ti;
                if(dp[a][b][c]+ma[a][i]+dtime<dp[i][nb][nc])
                {
                    dp[i][nb][nc]=dp[a][b][c]+ma[a][i]+dtime;
                    if(visit[i][nb][nc]==0)
                        visit[i][nb][nc]=1,que.push(mul(a,nb,nc));
                }
            }
        }

    }
    return 0;
}
int main()
{
    FILE *fptr=fopen("/home/moor/Code/input.txt","r");
    if(fptr==NULL)
    {
    	printf("NOT exist!");
    	return 0;
    }
    fclose(fptr);
    freopen("/home/moor/Code/input.txt","r",stdin);

    int ncase,n,m,k,ans;
    scanf("%d",&ncase);
    for(int h=1;h<=ncase;++h)
    {
        scanf("%d%d%d",&n,&m,&k);
        for(int i=0;i<=n;++i)
            for(int j=0;j<MAXN;++j)
                for(int l=0;l<MAXN;++l)
                    dp[i][j][l]=INF;
        memset(node,0,sizeof(node));
        memset(visit,0,sizeof(visit));
        for(int i=0;i<=n;++i)   node[i].is=-1;
        for(int i=0;i<=n;++i)
            for(int j=0;j<=n;++j)
                ma[i][j]=INF;
        for(int i=0;i<m;++i)
        {
            int a,b,c;
            scanf("%d%d%d",&a,&b,&c);
            ma[a][b]=ma[b][a]=c;
        }
        for(int i=0;i<k;++i)
        {
            int p,ni,tmp,nij;
            scanf("%d",&p);
            node[p].is=i;
            scanf("%d%d",&node[p].ti,&node[p].fi);
            tmp=1<<i;
            scanf("%d",&ni);
            for(int j=0;j<ni;++j)
            {
                scanf("%d",&nij);
                node[nij].have|=tmp;
            }
        }

        dp[1][0][0]=0;
        SPFA(n);
        ans=INF;
        for(int i=0;i<MAXN;++i)
            ans=min(ans,dp[1][i][MAXN-1]);
        printf("Case #%d: %d\n",h,ans);
    }
	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.