結果
| 問題 |
No.8042 本棚
|
| コンテスト | |
| ユーザー |
hamray
|
| 提出日時 | 2019-04-01 21:31:18 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 692 bytes |
| コンパイル時間 | 1,083 ms |
| コンパイル使用メモリ | 96,296 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 01:47:45 |
| 合計ジャッジ時間 | 1,945 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <map>
#include <algorithm>
#include <iomanip>
#include <cmath>
using namespace std;
#define MAXV 1000000000
#define MOD 1000000007
using ll = long long;
bool operator<(const pair<int, int>& a, const pair<int, int>& b) {
if (a.first == b.first) {
return a.second < b.second;
}
return a.first < b.first;
}
vector<pair<string, string>> vp;
int main() {
int N; cin >> N;
for (int i = 0; i < N; ++i) {
string s, id; cin >> s >> id;
vp.push_back({ s, id });
}
sort(vp.begin(), vp.end());
for (int i = 0; i < N; ++i) {
cout << vp[i].first << " " << vp[i].second << endl;
}
int a; cin >> a;
}
hamray