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 AC
Exec Time 23 ms
Memory 9180 KB

Judge Result

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