Language: C++

#include<iostream>
#include<algorithm>

using namespace std;
int clock[3001][3001];
int cost[3001][3001];


int main(){
	
	int i,j,k,a,b,t,c;
	int rail, station;
	int q,start,goal,dotti;
	int temp;
	
	


	while (1){
		
		cin >> rail >> station;
		
		if (rail == 0 && station == 0){
			break;
		}


		for (i = 0; i < station+1; i++){
			for (j = 0; j < station+1; j++){
				clock[i][j] = 1000000;
				cost[i][j] = 1000000;
			}
		}

		for (i = 0; i < rail; i++){
			cin >> a >> b >> c >> t;
			clock[a][b] = t;
			clock[b][a] = t;
			cost[a][b] = c;
			cost[b][a] = c;
		}


		cin >> q;

		for (;q>0;q--){
			cin >> start >> goal >> dotti;

			for (k = 1; k <= station; k++){
				for (i = 1; i <= station; i++){
					for (j = 1; j <= station; j++){
						cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
					}
				}
			}

			for (k = 1; k <= station; k++){
				for (i = 1; i <= station; i++){
					for (j = 1; j <= station; j++){
						clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
					}
				}
			}


			if (dotti == 0){
				cout << cost[start][goal] << endl;
			}

			if (dotti == 1){
				cout << clock[start][goal] << endl;
			}


		}
	


	}



}

Compiler output:
a.cc:5:21: error: 'int clock [3001][3001]' redeclared as different kind of entity
    5 | int clock[3001][3001];
      |                     ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:72:16: note: previous declaration 'clock_t clock()'
   72 | extern clock_t clock (void) __THROW;
      |                ^~~~~
a.cc: In function 'int main()':
a.cc:30:40: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                 clock[i][j] = 1000000;
      |                                        ^
a.cc:30:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                                 clock[i][j] = 1000000;
      |                                           ^
a.cc:30:45: error: assignment of read-only location '*(clock + (((sizetype)i) + ((sizetype)j)))'
   30 |                                 clock[i][j] = 1000000;
      |                                 ~~~~~~~~~~~~^~~~~~~~~
a.cc:37:32: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   37 |                         clock[a][b] = t;
      |                                ^
a.cc:37:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   37 |                         clock[a][b] = t;
      |                                   ^
a.cc:37:37: error: assignment of read-only location '*(clock + (((sizetype)a) + ((sizetype)b)))'
   37 |                         clock[a][b] = t;
      |                         ~~~~~~~~~~~~^~~
a.cc:38:32: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                         clock[b][a] = t;
      |                                ^
a.cc:38:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |                         clock[b][a] = t;
      |                                   ^
a.cc:38:37: error: assignment of read-only location '*(clock + (((sizetype)b) + ((sizetype)a)))'
   38 |                         clock[b][a] = t;
      |                         ~~~~~~~~~~~~^~~
a.cc:60:56: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                        ^
a.cc:60:59: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                           ^
a.cc:60:74: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                          ^
a.cc:60:77: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                             ^
a.cc:60:87: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                                       ^
a.cc:60:90: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                                          ^
a.cc:60:101: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                                                     ^
a.cc:60:104: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                                                        ^
a.cc:60:92: error: invalid operands of types 'clock_t() noexcept' {aka 'long int() noexcept'} and 'clock_t() noexcept' {aka 'long int() noexcept'} to binary 'operator+'
   60 |                                                 clock[i][j] = min(clock[i][j], clock[i][k] + clock[k][j]);
      |                                                                                ~~~~~~~~~~~ ^ ~~~~~~~~~~~
      |                                                                                          |             |
      |                                                                                          |             clock_t() noexcept {aka long int() noexcept}
      |                                                                                          clock_t() noexcept {aka long int() noexcept}
a.cc:71:52: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   71 |                                 cout << clock[start][goal] << endl;
      |                                                    ^
a.cc:71:58: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   71 |                                 cout << clock[start][goal] << endl;
      |                                                          ^