結果
問題 |
No.750 Frac #1
|
ユーザー |
|
提出日時 | 2018-11-09 21:26:52 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 1,000 ms |
コード長 | 565 bytes |
コンパイル時間 | 2,071 ms |
コンパイル使用メモリ | 199,352 KB |
最終ジャッジ日時 | 2025-01-06 15:57:13 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 30 |
ソースコード
//================================= // Created on: 2018/11/09 21:24:27 //================================= #include <bits/stdc++.h> int main() { int N; std::cin >> N; using P = std::pair<int, int>; std::vector<P> c(N); for (int i = 0; i < N; i++) { std::cin >> c[i].first >> c[i].second; } auto comp = [](const P& p1, const P& p2) { return p1.first * p2.second > p1.second * p2.first; }; std::sort(c.begin(), c.end(), comp); for (int i = 0; i < N; i++) { std::cout << c[i].first << " " << c[i].second << std::endl; } return 0; }