結果
問題 |
No.8042 本棚
|
ユーザー |
![]() |
提出日時 | 2023-08-03 01:46:03 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 562 bytes |
コンパイル時間 | 1,997 ms |
コンパイル使用メモリ | 179,716 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-12 23:51:22 |
合計ジャッジ時間 | 2,891 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; int strToi(string &s){ if(s == "iti") return 1; else if(s == "ni") return 2; else if(s == "san") return 3; else if(s == "yon") return 4; return 0; } int main() { int n; cin >> n; vector<pair<string, int>> sId(n); string tmp; for(int i = 0; i < n; i++){ cin >> sId[i].first; cin >> tmp; sId[i].second = strToi(tmp); } sort(sId.begin(), sId.end()); for(const auto& str: sId){ cout << str.first << " " << str.second << endl; } }