結果
問題 | No.571 3人兄弟(その2) |
ユーザー |
![]() |
提出日時 | 2017-11-10 05:20:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 467 bytes |
コンパイル時間 | 179 ms |
コンパイル使用メモリ | 35,536 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-24 10:38:03 |
合計ジャッジ時間 | 691 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:16:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 16 | for(int i=0;i<3;i++)scanf("%d%d",&a[i].h,&a[i].w); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>#include <algorithm>using namespace std;struct people{int h;int w;};bool cmp(people a,people b){if(a.h==b.h)return a.w<b.w;return a.h>b.h;}int main(){int c[3]={0,1,2};people a[3];char b[3]={'A','B','C'};for(int i=0;i<3;i++)scanf("%d%d",&a[i].h,&a[i].w);for(int i=0;i<6;i++){if(cmp(a[c[0]],a[c[1]])&&cmp(a[c[1]],a[c[2]]))printf("%c\n%c\n%c\n",b[c[0]],b[c[1]],b[c[2]]);next_permutation(c,c+3);}}