結果
| 問題 |
No.571 3人兄弟(その2)
|
| コンテスト | |
| ユーザー |
AQUA16573837
|
| 提出日時 | 2018-04-05 00:46:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 636 bytes |
| コンパイル時間 | 781 ms |
| コンパイル使用メモリ | 61,024 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 08:59:34 |
| 合計ジャッジ時間 | 1,406 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
コンパイルメッセージ
main.cpp: In function ‘void solve()’:
main.cpp:24:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
24 | scanf("%d %d", &br[0].h, &br[0].w);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:25:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
25 | scanf("%d %d", &br[1].h, &br[1].w);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
main.cpp:26:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
26 | scanf("%d %d", &br[2].h, &br[2].w);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <algorithm>
#include <deque>
#include <string>
#include <iostream>
using namespace std;
using ll = long long;
void solve();
int main() {
solve();
#ifdef DBG
while (true);
#endif
}
//571
class status {
public:
int h, w;
};
void solve() {
status br[3];
scanf("%d %d", &br[0].h, &br[0].w);
scanf("%d %d", &br[1].h, &br[1].w);
scanf("%d %d", &br[2].h, &br[2].w);
int idx[3];
idx[0] = 0, idx[1] = 1, idx[2] = 2;
sort(idx, idx + 3, [&](int a, int b) {
if (br[a].h != br[b].h)
return br[a].h > br[b].h;
return br[a].w < br[b].w;
});
for (int i = 0; i < 3; i++)
printf("%c\n", 'A' + idx[i]);
}
AQUA16573837