merchant.cpp:9:1: error: expected unqualified-id before 'for'
for (int i = 1; i <= N; i++) dist[i] = INF;
^~~
merchant.cpp:9:17: error: 'i' does not name a type
for (int i = 1; i <= N; i++) dist[i] = INF;
^
merchant.cpp:9:25: error: 'i' does not name a type
for (int i = 1; i <= N; i++) dist[i] = INF;
^
merchant.cpp:10:11: error: expected constructor, destructor, or type conversion before '(' token
memset(ok, 0, sizeof(ok));
^
merchant.cpp: In function 'int main()':
merchant.cpp:54:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &N, &M, &K);
~~~~~^~~~~~~~~~~~~~~~~~~~~~
merchant.cpp:57:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%lld%lld", &buy[i][k], &sell[i][k]);
~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
merchant.cpp:69:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
scanf("%d%d%d", &a, &b, &c);
~~~~~^~~~~~~~~~~~~~~~~~~~~~