結果
問題 |
No.8042 本棚
|
ユーザー |
|
提出日時 | 2020-08-01 11:12:32 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 640 bytes |
コンパイル時間 | 1,893 ms |
コンパイル使用メモリ | 87,460 KB |
最終ジャッジ日時 | 2025-01-12 12:27:30 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> const std::vector<std::string> ss{"iti", "ni", "san", "yon"}; void solve() { int n; std::cin >> n; std::vector<std::pair<std::string, int>> ps(n); for (auto& p : ps) { std::string t; std::cin >> p.first >> t; for (int i = 0; i < 4; ++i) { if (t == ss[i]) p.second = i; } } std::sort(ps.begin(), ps.end()); for (auto p : ps) { std::cout << p.first << " " << ss[p.second] << "\n"; } } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }