結果
問題 | No.571 3人兄弟(その2) |
ユーザー |
👑 |
提出日時 | 2020-02-11 22:59:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 510 bytes |
コンパイル時間 | 690 ms |
コンパイル使用メモリ | 75,296 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-01 08:53:48 |
合計ジャッジ時間 | 1,315 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;struct dta{char name;int hgt,wgt;};bool comp(const dta&df,dta&ds){if(df.hgt == ds.hgt){return df.wgt < ds.wgt;}else{return df.hgt > ds.hgt;}}int main(){vector<dta> Z(3);for(int i = 0; 3 > i; i++){Z[i].name = 'A'+i;cin>>Z[i].hgt >> Z[i].wgt;}sort(Z.begin(),Z.end(),comp);for(int i = 0; 3 > i; i++){cout << Z[i].name << endl;}}