Submission #1252938

#TimeUsernameProblemLanguageResultExecution timeMemory
1252938mardaTrol (COCI19_trol)C++20
Compilation error
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; }

Compilation message (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;
      |                            ^~~~