|
|
back to boardWA #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? 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 |
|
|