Submission #13026464


Source Code Expand

Copy
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,_,k=map(int,input().split())
    if k<=a:
        print(k)
    elif k>a and k<=a+b:
        print(a)
    else:
        print(a-(k-a-b))
if __name__=='__main__':
    main()

Submission Info

Submission Time
Task B - Easy Linear Programming
User charter
Language Python (3.8.2)
Score 200
Code Size 263 Byte
Status
Exec Time 23 ms
Memory 9180 KB

Judge Result

Set Name Score / Max Score Test Cases
All 200 / 200 sample_01.txt, sample_02.txt, sample_03.txt, testcase_1.txt, testcase_10.txt, testcase_11.txt, testcase_12.txt, testcase_2.txt, testcase_3.txt, testcase_4.txt, testcase_5.txt, testcase_6.txt, testcase_7.txt, testcase_8.txt, testcase_9.txt
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
sample_01.txt 20 ms 8896 KB
sample_02.txt 17 ms 9048 KB
sample_03.txt 17 ms 8992 KB
testcase_1.txt 20 ms 8880 KB
testcase_10.txt 18 ms 9040 KB
testcase_11.txt 17 ms 8892 KB
testcase_12.txt 19 ms 9040 KB
testcase_2.txt 17 ms 8992 KB
testcase_3.txt 20 ms 9052 KB
testcase_4.txt 23 ms 9112 KB
testcase_5.txt 21 ms 9000 KB
testcase_6.txt 17 ms 8880 KB
testcase_7.txt 19 ms 9048 KB
testcase_8.txt 16 ms 8888 KB
testcase_9.txt 17 ms 9180 KB