[PYTHON] Strengthen with code test ④

Challenged problem C76

Result: 21 points Time: 60 minutes

Re-challenge: 100 After all, it turned out that thinking ability declines when time is chased.

To next time

After all, the most important thing to pay attention to in such a problem was the ** boundary of conditions **. I was able to succeed if I cleared the boundary of the condition Write the death code as a hint.

Death code

Death code

```python

coding: utf-8

#In your favorite language

Let's Challenge! !!

x_time,y_time,z_time = input().split() #print(x_time, y_time, z_time)

day = int(input()) #print(day)

import sys line = sys.stdin.readlines()

result = [] #ghsfrh

""" for i in range(day): start, end = line[i].split()

dayss = []
days = int(end)-int(start)
#print(days)

for i in range(int(start), int(end)):
    dayss.append(i)

print(len(dayss))
print(dayss)

for j in range(len(dayss)):
    if 0 <= j and 8 >= j:
        result.append(int(z_time))
    elif 9 <= j and 17 >= j:
        result.append(int(x_time))
    elif 17 <= j and 22 >= j:
        result.append(int(y_time))
    else:
        print("Off hours")
    print(sum(result))

"""

for i in range(day): start, end = line[i].split() if int(start) >= 0 and int(end) <= 9: z_tiem_result = (int(end)-int(start)) * int(z_time) result.append(z_tiem_result) #print(z_tiem_result) elif int(start) >= 9 and int(end) <= 17: x_time_result = (int(end)-int(start)) * int(x_time) result.append(x_time_result) #print(x_time_result, result)

elif int(start) >= 17 and int(end) <= 22:
    y_time_result = (int(end)-int(start)) * int(y_time)
    result.append(y_time_result)
    #print(y_time_result, result)
elif int(start) >= 22:
    z_tiem_result = (int(end)-int(start)) * int(z_time)
    result.append(z_tiem_result)
    #print(z_tiem_result, result)
else:
    #print("Off hours")
    pass

#print(result)

print(sum(result))

```

Recommended Posts

Strengthen with code test ⑦
Strengthen with code test ⑨
Strengthen with code test ③
Strengthen with code test ⑤
Strengthen with code test ④
Strengthen with code test ②
Strengthen with code test ①
Strengthen with code test ⑧
Strengthen with code test ⑨
Primality test with Python
Primality test with python
[Memo] Test code summary
Hamming code with numpy
In-house test code culture starting with just one person
Python with VS Code (Windows 10)
Test embedded software with Google Test
Unit test flask with pytest
Test standard output with Pytest
PyCharm test code automatic generation
Test code for evaluating decorators
Debug Python with VS Code
Load test Websocket with Locust
Check the code with flake8
Document Python code with Doxygen
Test Driven Development with Django Part 3
Decrypt the QR code with CNN
Java with Visual Studio Code (Part 2)
Test Driven Development with Django Part 6
Classify "Wine" with TensorFlow MLP code
Test Driven Development with Django Part 2
test
Unit test log output with python
Write selenium test code in python
Try running Jupyter with VS Code
It was with Nintendo's Code Puzzle
Test Driven Development with Django Part 1
Install python with mac vs code
Test Driven Development with Django Part 5
Controlling test reruns with Luigi + pytest
Automatic sample test case & manual input value test execution with VS Code with AtCoder
Python code to train and test with Custom Vision of Cognitive Service
[Python] Super easy test with assert statement
Stress Test with Locust written in Python
Test Python non-functional programs with GitLab CI
Image classification with Keras-From preprocessing to classification test-
WebUI test with Python2.6 + Selenium 2.44.0 --profile setting
Isn't it okay to write test code?
Generate Japanese test data with Python faker
Post Test 3 (Working with PosgreSQL in Python)
Create documentation and test code using doctest.testfile ()
Pass PYTHONPATH in 1 minute with VS Code
Display Japanese graphs with VS Code + matplotlib
How to do portmanteau test with python
Integrating with setuptools / python setup.py test / pytest-runner
Test automation starting with L-Chika (3) Oscilloscope integration
VS Code Pylint is annoying with import! !! !! !!
Automate Facebook App Testing with Facebook Test Users
python setup.py test the code using multiprocess