結果
| 問題 |
No.750 Frac #1
|
| コンテスト | |
| ユーザー |
startcpp
|
| 提出日時 | 2018-11-09 21:24:31 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 421 bytes |
| コンパイル時間 | 578 ms |
| コンパイル使用メモリ | 70,100 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-21 05:30:09 |
| 合計ジャッジ時間 | 1,578 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
#include <iostream>
#include <tuple>
#include <algorithm>
#include <functional>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;
typedef tuple<double, int, int> T;
int n;
int a, b;
T t[10];
int main() {
int i;
cin >> n;
rep(i, n) {
cin >> a >> b;
t[i] = T((double)a / b, a, b);
}
sort(t, t + n, greater<T>());
rep(i, n) {
cout << get<1>(t[i]) << " " << get<2>(t[i]) << endl;
}
return 0;
}
startcpp