CSES - Datatähti 2025 alku - Results
Submission details
Task:Pizzat
Sender:Username*
Submission time:2024-10-28 09:55:55 +0200
Language:C++ (C++20)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:10:18: error: 'floor' was not declared in this scope
   10 |     float ans2 = floor(ans) == ans ? ans : floor(ans) + 1;
      |                  ^~~~~

Code

#include <iostream>

using namespace std;

int main() {
    float n, m, k;
    cin >> n >> m >> k;

    float ans = (m * k)/n;
    float ans2 = floor(ans) == ans ? ans : floor(ans) + 1;
    
    cout << floor(ans) << " " << ans2;
    return 0;
}