結果

問題 No.571 3人兄弟(その2)
ユーザー sotanakajimacl1sotanakajimacl1
提出日時 2017-10-06 23:23:36
言語 C++11
(gcc 11.4.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 641 bytes
コンパイル時間 1,147 ms
コンパイル使用メモリ 143,856 KB
実行使用メモリ 4,508 KB
最終ジャッジ日時 2023-08-10 17:26:09
合計ジャッジ時間 3,773 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int out(int)’:
main.cpp:8:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int h[3],w[3],jyuni[3];
int out(int a){
    if(a==0) cout<<"A"<<endl;
    else if(a==1) cout<<"B"<<endl;
    else cout<<"C"<<endl;
}
int main(){
    for(int i=0;i<3;i++){
        cin>>h[i]>>w[i];
    }
    for(int i=0;i<3;i++){
        jyuni[i]++;
        for(int j=0;j<3;j++){
            if(i!=j){
                if(h[i]<h[j]) jyuni[i]++;
                if(h[i]==h[j]){
                    if(w[i]>w[j]) jyuni[i]++;
                } 
            }
        }
    }   
    for(int i=1;i<=3;i++){
        for(int j=0;j<3;j++){
            if(jyuni[j]==i) out(j);
        }
    }
    return 0;
}
0