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

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:7:32: warning: right operand of comma operator has no effect [-Wunused-value]
    7 |     std::cin >> people, pizza, size;
      |                                ^~~~
input/code.cpp:7:36: warning: right operand of comma operator has no effect [-Wunused-value]
    7 |     std::cin >> people, pizza, size;
      |                                    ^
input/code.cpp:10:18: error: 'floor' was not declared in this scope
   10 |     std::cout << floor(pieces / people) << " " << ceil(pieces / people);
      |                  ^~~~~
input/code.cpp:10:51: error: 'ceil' was not declared in this scope
   10 |     std::cout << floor(pieces / people) << " " << ceil(pieces / people);
      |                                                   ^~~~

Code

#include <iostream>

int main()
{
    double people, pizza, size;

    std::cin >> people, pizza, size;

    double pieces = pizza * size;
    std::cout << floor(pieces / people) << " " << ceil(pieces / people);
}