50 WA 求助
  • 板块题目总版
  • 楼主Lovely_Elaina
  • 当前回复11
  • 已保存回复11
  • 发布时间2023/3/13 20:42
  • 上次更新2023/10/23 21:38:22
查看原帖
50 WA 求助
781159
Lovely_Elaina楼主2023/3/13 20:42

#include <iostream>
#define int long long
using namespace std;

int a,b,c,d;

signed main(){
    ios::sync_with_stdio(0);
    cin.tie(NULL);
    
    //     鸡鸡 羊羊 角角 腿腿
    cin >> a >> b >> c >> d;
    
    if(b*2 == c && a*2+b*4 == d){
        cout << -1 << endl;
        cout << -1 << endl;
        return 0;
    }
    
    int x = d-(a*2+b*4); // 腿腿
    int y = c-b*2;       // 角角
    
    if(y < 0 || x <= -2){
        cout << -1 << endl;
    }else{
        cout << y << " " << x+2 << endl;
    }
    
    if(y <= -2 || x <= -4){
        cout << -1 << endl;
    }else{
        cout << y+2 << " " << x+4 << endl;
    }
    
    return 0;
}

先润去写作业力

2023/3/13 20:42
加载中...