P7042 「MCOI-03」正方

Aimee

很简单的一个小题

分类讨论啊
--scz

#include<iostream>
#include<algorithm>
#include<cstdio>
#define int long long
using namespace std;
int q;
int len[5];
signed main(){
    scanf("%lld",&q);
    for(int i=1;i<=q;++i){
        scanf("%lld%lld%lld%lld",&len[1],&len[2],&len[3],&len[4]);
        sort(len+1,len+4+1);
        if(len[1]+len[4]!=len[2]+len[3]){
            cout<<0<<endl;
            continue;
        }
        if(len[1]==len[2]&&len[2]==len[3]&&len[3]==len[4]){
        cout<<1<<endl;
        }else{
            if(len[1]==len[2]&&len[3]==len[4]){
                cout<<4<<endl;
            }else{
                if(len[1]==len[2]||len[3]==len[4]){
                    cout<<2<<endl;
                }else{
                    if(len[1]+len[4]==len[2]+len[3]){
                        cout<<8<<endl;
                    }else{
                        cout<<0<<endl;
                    }
                }
            }
        } 
    }
    return 0;
}
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇