2 条题解

  • 1
    @ 2025-10-4 20:40:20

    注意范围

    #include<stdio.h>
    int main()
    {
        long long int a,b,t;
        scanf("%lld",&t);
        while(t--){
            scanf("%lld%lld",&a,&b);
            if(a==0&&b==0){
                printf("1\n");
            }else if(a==0&&b!=0){
                printf("1\n");
            }else{
                printf("%lld\n",a+2*b+1);
            }
        }
        return 0;
    }
    
    • 0
      @ 2025-10-4 16:28:21

      思维题

      #include <iostream>
      using namespace std;
      int main(){
      	int t; 
      	cin >> t;
      	while(t--){
      		int a,b;
      		cin >> a >> b;
      		if(a == 0 && b == 0){
      			cout << 1 << endl;
      		}else if(a == 0 && b != 0){
      			cout << 1 << endl;
      		}else{
      			cout << a + 2 * b + 1 << endl;
      		}		
      	}
      }
      
      • 1

      信息

      ID
      1128
      时间
      1000ms
      内存
      256MiB
      难度
      8
      标签
      (无)
      递交数
      120
      已通过
      19
      上传者