Language: C++

#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <map>
#include <list>
#include <algorithm>

using namespace std;
typedef char CHAR;
typedef unsigned char UCHAR;
typedef short SHORT;
typedef unsigned short USHORT;
typedef int INT;
typedef unsigned int UINT;
typedef long long LLONG;
typedef unsigned long long ULLONG;

#define LengthOf(x)    (sizeof(x) / sizeof(x[0]))
#define PI 3.14159265358979323846

#if 0
//No.4
typedef struct {
	INT dist;
	INT prevRoom;
	vector<INT> link;
} NODE;

//深さ優先
void update(NODE* node, INT curRoom, INT prevRoom, INT dist, INT* roomCnt)
{
	//update dist
	if (dist < node[curRoom].dist) {
		if (node[curRoom].dist == 0x7FFFFFFF) { *roomCnt += 1; }	//reached room count.

		node[curRoom].dist = dist;
		node[curRoom].prevRoom = prevRoom;

		//next room
		for (int i = 0; i < node[curRoom].link.size(); ++i) {
			update(node, node[curRoom].link[i], curRoom, dist + 1, roomCnt);
		}
	}
}

//幅優先
typedef struct {
	INT curRoom;
	INT prevRoom;
	INT dist;
} QUERY;

void update2(NODE* node, INT curRoom, INT prevRoom, INT dist, INT* roomCnt, list<QUERY>* query)
{
	//update dist
	if (dist < node[curRoom].dist) {
		if (node[curRoom].dist == 0x7FFFFFFF) { *roomCnt += 1; }	//reached room count.

		node[curRoom].dist = dist;
		node[curRoom].prevRoom = prevRoom;

		//next room
		for (int i = 0; i < node[curRoom].link.size(); ++i) {
			//update(node, node[curRoom].link[i], curRoom, dist + 1, roomCnt);
			QUERY newQuery;
			newQuery.curRoom = node[curRoom].link[i];
			newQuery.prevRoom = curRoom;
			newQuery.dist = dist + 1;
			query->push_back(newQuery);
		}
	}

	if (query->empty() == false) {
		QUERY proc = query->front();
		query->pop_front();
		update2(node, proc.curRoom, proc.prevRoom, proc.dist, roomCnt, query);
	}
}

int main()
{
	INT N, M;
	cin >> N >> M;

	NODE* node = new NODE[N + 1];
	for (int i = 0; i < N + 1; ++i) {
		node[i].prevRoom = 0;
		node[i].dist = 0x7FFFFFFF;
	}

	for (int i = 0; i < M; ++i) {
		INT a, b;
		cin >> a >> b;
		node[a].link.push_back(b);
		node[b].link.push_back(a);
	}

	INT roomCnt = 0;
	//update(node, 1, 0, 0, &roomCnt);
	list<QUERY> query;
	update2(node, 1, 0, 0, &roomCnt, &query);

	if (roomCnt != N) {
		cout << "No";
	}
	else {
		cout << "Yes" << endl;
		for (int i = 2; i < N + 1; ++i) {
			cout << node[i].prevRoom << endl;
		}
	}

	return 0;
}
#endif

#if 1
//No.3
int main()
{
	//余弦定理
	INT A, B, H, M;
	cin >> A >> B >> H >> M;

	double theta_H = 360.0 * ((60.0 * H + M) / (60.0 * 12));
	double theta_M = 360.0 * (M / 60.0);

	double theta = abs(theta_H - theta_M);
	if (theta > 180) { theta = 360 - theta; }

	double c_pow2 = A * A + B * B - 2 * A*B*cos(2 * PI * (theta / 360));
	//cout << sqrt(c_pow2);
	printf("%.16lf", sqrt(c_pow2));

	return 0;
}
#endif

Compiler output:
a.cc: In function 'int main()':
a.cc:133:49: error: 'cos' was not declared in this scope
  133 |         double c_pow2 = A * A + B * B - 2 * A*B*cos(2 * PI * (theta / 360));
      |                                                 ^~~
a.cc:135:26: error: 'sqrt' was not declared in this scope
  135 |         printf("%.16lf", sqrt(c_pow2));
      |                          ^~~~