結果
問題 | No.8042 本棚 |
ユーザー |
![]() |
提出日時 | 2019-04-01 21:07:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 926 bytes |
コンパイル時間 | 1,992 ms |
コンパイル使用メモリ | 180,288 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 01:37:37 |
合計ジャッジ時間 | 2,919 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
main.cpp: In function 'int toint(std::string)': main.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type] 16 | } | ^ main.cpp: In function 'std::string tostr(int)': main.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type] 23 | } | ^
ソースコード
#include <bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<ll, ll> l_l;typedef pair<string, int> s_i;#define EPS (1e-7)#define INF (1e9)#define PI (acos(-1))//const ll mod = 1000000007;int toint(string in) {if(in == "iti") return 1;if(in == "ni") return 2;if(in == "san") return 3;if(in == "yon") return 4;}string tostr(int in) {if(in == 1) return "iti";if(in == 2) return "ni";if(in == 3) return "san";if(in == 4) return "yon";}int main() {//cout.precision(10);cin.tie(0);ios::sync_with_stdio(false);int N;cin >> N;vector<s_i> v(N);for(int i = 0; i < N; i++) {cin >> v[i].first;string id;cin >> id;v[i].second = toint(id);}sort(v.begin(), v.end());for(int i = 0; i < N; i++) {cout << v[i].first << " " << tostr(v[i].second) << endl;}return 0;}