학교에서 문제 풀기 시작하는 중인데
문제11번 동맹 휴업(Hartal)을 풀어봤거든..,
학교컴이 느려서 그런가?? 짤방처럼 결과가 나오더라고...
컴파일 실행 결과 이상없이 제대로 나왔는데
http://www.programming-challenges.com/pg.php?page=submission
요기에서 submit 하면.. 한참뒤에 저렇게 메세지 뜨는데..
인터넷 느려서 그런거야? 아니면 내가 잘못 짠건가..

소스도 같이올릴게..
#include <stdio.h>
#include <stdlib.h>

void main()
{
 int cnt;
 int *N, *P, **H, *result;

 scanf(\"%d\", &cnt);


 N = (int *)malloc(sizeof(int) * cnt);
 H = (int **)malloc(sizeof(int *) * cnt);
 P = (int *)malloc(sizeof(int) * cnt);
 result = (int *)malloc(sizeof(int) * cnt);

 for(int i = 0; i < cnt; i++)
 {
  scanf(\"%d\", &N[i]);

  scanf(\"%d\", &P[i]);

  H[i] = (int *)malloc(sizeof(int) * P[i]);
  for(int j = 0; j < P[i]; j++)
  {
   scanf(\"%d\", &H[i][j]);
  }

  result[i] = 0;

  for(j = 0; j < N[i]; j++)
  {
   for(int k = 0; k < P[i]; k++)
   {
    if( (j+1) % H[i][k] == 0)
    {
     break;
    }
   }

   if(P[i] != k && (j % 7 != 5 && j % 7 != 6) )
   {
    result[i]++;
   }
  }
 }

 for(i = 0; i < cnt; i++)
 {
  printf(\"%d\\n\", result[i]);

  free(H[i]);
 }
 free(N);
 free(P);
}