제출 #1252938

#제출 시각아이디문제언어결과실행 시간메모리
1252938mardaTrol (COCI19_trol)C++20
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <tuple>

#define endl "\n"
#define int long long int
#define ld long double
#define mp make_pair
#define pb push_back
#define Bound 1001

using namespace std;


int32_t main()
{

	int t;
	cin >> t;

	while (t--) {

		int a, b;
		cin >> a >> b;


		int firstNum = (a - 1) % 9 + 1;
		int secondNum = (b - 1) % 9 + 1;
		int difference = b - a + 1;

		int totalTo9_1st = (10 - firstNum) * (9 + firstNum) / 2;
		int totalTo9_2nd = (secondNum) * (1 + secondNum) / 2;

		int dfrc = ceil((float)b / 9) - ceil((float)a / 9) - 1;

		cout << totalTo9_1st + totalTo9_2nd + dfrc * 45 << endl;

	}

	return 0;

}

컴파일 시 표준 에러 (stderr) 메시지

trol.cpp: In function 'int32_t main()':
trol.cpp:37:28: error: 'ceil' was not declared in this scope
   37 |                 int dfrc = ceil((float)b / 9) - ceil((float)a / 9) - 1;
      |                            ^~~~