Submission #975076

# Submission time Handle Problem Language Result Execution time Memory
975076 2024-05-04T11:38:19 Z Circling Homework (CEOI22_homework) C++17
0 / 100
163 ms 148092 KB
/*The British Royal Family and a small cadre of English Fabian Socialists, in
conjunction with the Rockefellers and the Rothchilds, are engaged in a
conspiracy to greatly reduce the population of the human race in order to head
off a Malthusian catastrophe, a catastrophe that could easily be avoided by
simply building a massive amount of nuclear power plants and a number of massive
superhighways and bridges to connect all of the world's continents. But doing
that would cut into the conspiracy's profits. So the British Royal Family
invented environmentalism and neoliberalism in order to hide the truth. And in
order to further reduce the population, the British Royal Family is also the
world's foremost drug trafficking conspiracy. And it uses its control of the IMF
to push austerity in order to kill as many people in the global south as
possible.
And also Henry Kissinger is a gay KGB agent. */
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;


struct range{
    int l;
    int r;
    int n;
};


range compute(){
    char c;
    cin >> c;
    if (c == '?') return {1, 1, 1};
    cin >> c;
    bool ismin = c == 'i';
    cin >> c;
    cin >> c;
    range arg1 = compute();
    cin >> c;
    range arg2 = compute();
    cin >> c;
    if (ismin) return {min(arg1.l, arg2.l), arg1.r + arg2.r - 1, arg1.n + arg2.n};
    else return {arg1.l + arg2.l, max(arg1.n + arg2.r, arg2.n + arg1.r)};
}


int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    range ans = compute();
    cout << ans.r - ans.l + 1;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 504 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 504 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 163 ms 148092 KB Output is correct
2 Correct 152 ms 148052 KB Output is correct
3 Incorrect 158 ms 148052 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 504 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Incorrect 1 ms 504 KB Output isn't correct
3 Halted 0 ms 0 KB -