Language: C

#include<stdio.h>
#include<math.h>
int R=1,C=1,H[1000010]={0};
int N[1000010]={-1000};
//ヒープに入れる
void hin(int a){
  int i=C++;
  for(N[R]=a;a<N[H[i/2]];i/=2)H[i]=H[i/2];#include<stdio.h>
#include<math.h>
int R=1,C=1,H[1000010]={0};
int N[1000010]={-1000};
//ヒープに入れる
void hin(int a){
  int i=C++;
  for(N[R]=a;a<N[H[i/2]];i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//ヒープから最小値を取り出す
int hout(){
  int rt=H[1],nt=1,i=0,k=H[--C];
  while(nt-i){
    H[i=nt]=k;
    if(i*2  <C&&N[  k  ]>N[H[i*2  ]])H[i]=H[nt=i*2  ];
    if(i*2+1<C&&N[H[nt]]>N[H[i*2+1]])H[i]=H[nt=i*2+1];
  }
  return rt;
}
int CO[500010];
  int i,id[500010],ta[100010],nt[500010],f[500010]={0};
void dijk(int v,int e,int *fr,int *to,int *co,int mi){
  //int i,id[500010],ta[100010],nt[500010],f[500010]={0};
  for(i=0;i<v;i++)ta[i]=-1;
  for(i=0;i<v;i++)CO[i]=1000000000;
  for(i=CO[mi]=0;i<e;i++){
    nt[i]=ta[fr[i]];
    ta[fr[i]]=i;
  }
  while(f[mi]-1){
    f[mi]=1;
    for(i=ta[mi];i+1;i=nt[i]){
      if(CO[to[i]]>CO[mi]+co[i])hin(CO[id[R]=to[i]]=CO[mi]+co[i]);
    }
    while(f[mi]&&C-1)mi=id[hout()];
  }
}
int main(){
  int n,m,s,a[500010],b[500010],c[500010],i;
  scanf("%d %d %d",&n,&m,&s);
  for(i=0;i<m;i++)scanf("%d %d %d",&a[i],&b[i],&c[i]);
  dijk(n,m,a,b,c,s);
  for(i=0;i<n;i++)CO[i]-1000000000?printf("%d\n",CO[i]):printf("INF\n");
  return 0;
}

  H[i]=R++;
}
//ヒープから最小値を取り出す
int hout(){
  int rt=H[1],nt=1,i=0,k=H[--C];
  while(nt-i){
    H[i=nt]=k;
    if(i*2  <C&&N[  k  ]>N[H[i*2  ]])H[i]=H[nt=i*2  ];
    if(i*2+1<C&&N[H[nt]]>N[H[i*2+1]])H[i]=H[nt=i*2+1];
  }
  return rt;
}
int CO[500010];
  int i,id[500010],ta[100010],nt[500010],f[500010]={0};
void dijk(int v,int e,int *fr,int *to,int *co,int mi){
  //int i,id[500010],ta[100010],nt[500010],f[500010]={0};
  for(i=0;i<v;i++)ta[i]=-1;
  for(i=0;i<v;i++)CO[i]=1000000000;
  for(i=CO[mi]=0;i<e;i++){
    nt[i]=ta[fr[i]];
    ta[fr[i]]=i;
  }
  while(f[mi]-1){
    f[mi]=1;
    for(i=ta[mi];i+1;i=nt[i]){
      if(CO[to[i]]>CO[mi]+co[i])hin(CO[id[R]=to[i]]=CO[mi]+co[i]);
    }
    while(f[mi]&&C-1)mi=id[hout()];
  }
}
int main(){
  int n,m,s,a[500010],b[500010],c[500010],i;
  scanf("%d %d %d",&n,&m,&s);
  for(i=0;i<m;i++)scanf("%d %d %d",&a[i],&b[i],&c[i]);
  dijk(n,m,a,b,c,s);
  for(i=0;i<n;i++)CO[i]-1000000000?printf("%d\n",CO[i]):printf("INF\n");
  return 0;
}

Compiler output:
main.c: In function 'hin':
main.c:8:43: error: stray '#' in program
    8 |   for(N[R]=a;a<N[H[i/2]];i/=2)H[i]=H[i/2];#include<stdio.h>
      |                                           ^
main.c:8:44: error: 'include' undeclared (first use in this function)
    8 |   for(N[R]=a;a<N[H[i/2]];i/=2)H[i]=H[i/2];#include<stdio.h>
      |                                            ^~~~~~~
main.c:8:44: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:52: error: 'stdio' undeclared (first use in this function); did you mean 'stdin'?
    8 |   for(N[R]=a;a<N[H[i/2]];i/=2)H[i]=H[i/2];#include<stdio.h>
      |                                                    ^~~~~
      |                                                    stdin
main.c:10:1: error: expected expression before 'int'
   10 | int R=1,C=1,H[1000010]={0};
      | ^~~
main.c:29:7: error: redeclaration of 'i' with no linkage
   29 |   int i,id[500010],ta[100010],nt[500010],f[500010]={0};
      |       ^
main.c:7:7: note: previous definition of 'i' with type 'int'
    7 |   int i=C++;
      |       ^