2 条题解

  • 0
    @ 2024-1-7 13:32:39
    import java.util.Scanner;
    
    public class Main {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            int x = sc.nextInt();
            int y = sc.nextInt();
            int k = sc.nextInt();
            if(x >= y){
                System.out.println(x);
            }else {
                if(x + k >= y){
                    System.out.println(y);
                }else {
                    int d = x + k;
                    System.out.println(d + (y - d) * 2);
                }
            }
        }
    }
    
    

    信息

    ID
    596
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    243
    已通过
    69
    上传者