ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1925. British Scientists Save the World

WA #4;can anyone help?
Posted by jim 8 Mar 2018 15:14
#include <iostream>

using namespace std;

int main()
{
        int n, k;
        int i;
        int show, type;
        int showTotal = 0, typeTotal = 0;
        int neededType;

        cin >> n >> k;
        for ( i = 1; i <= n; i++)
        {
                cin >> show >> type;

                if (show - type == 2)
                        showTotal = typeTotal = 0;
                else
                {
                        showTotal += show;
                        typeTotal += type + 2;
                }
        }
        neededType = k + showTotal - typeTotal - 2;
        if (neededType > 0 && neededType < 101)
                cout << neededType << endl;
        else
        {
                cout << "Big Bang!" << endl;
        }
        return 0;
}
Re: WA #4;can anyone help?
Posted by Roman Hrynevych 21 Jan 2020 23:10
maybe problem in this
neededType > 0 || neededType < 101

UPD: result must be only bigger than zero! i have AC)

Edited by author 21.01.2020 23:21