結果
| 問題 |
No.571 3人兄弟(その2)
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2017-10-07 02:07:39 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 945 bytes |
| コンパイル時間 | 623 ms |
| コンパイル使用メモリ | 86,088 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-17 03:18:03 |
| 合計ジャッジ時間 | 1,176 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:53:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
53 | scanf("%d%d", &hi, &wi);
| ~~~~~^~~~~~~~~~~~~~~~~~
ソースコード
/* -*- coding: utf-8 -*-
*
* 571.cc: No.571 3人兄弟(その2) - yukicoder
*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
using namespace std;
/* constant */
const int N = 3;
/* typedef */
struct Stat {
int h, w, i;
Stat() {}
Stat(int _h, int _w, int _i): h(_h), w(_w), i(_i) {}
bool operator<(const Stat &s) const {
return h > s.h || (h == s.h && w < s.w);
}
};
/* global variables */
Stat hws[N];
/* subroutines */
/* main */
int main() {
for (int i = 0; i < N; i++) {
int hi, wi;
scanf("%d%d", &hi, &wi);
hws[i] = Stat(hi, wi, i);
}
sort(hws, hws + N);
for (int i = 0; i < N; i++) printf("%c\n", 'A' + hws[i].i);
return 0;
}
tnakao0123