結果
問題 | No.1335 1337 |
ユーザー |
|
提出日時 | 2021-05-05 13:27:10 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,444 bytes |
コンパイル時間 | 2,019 ms |
コンパイル使用メモリ | 192,892 KB |
最終ジャッジ日時 | 2025-01-21 07:17:00 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 14 |
ソースコード
#include "bits/stdc++.h" using namespace std; #define _CRT_SECURE_NO_WARINGS #define INIT ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) #define ALL(obj) (obj).begin(),(obj).end() #define RALL(obj) (obj).rbegin(),(obj).rend() #define SORT(obj) sort(ALL(obj)) #define RSORT(obj) sort(RALL(obj)) #define REP(i,n) for(int i = 0; i < (n); ++i) #define COUT_ALL(x) for(auto i=x.begin();i!=--x.end();i++)cout<<*i<<" ";cout<<*--x.end()<<endl; using ll = long long; using P = pair<int, int>; using VI = vector<int>; using VP = vector<P>; const int INF = 1e9; const int MOD = 1e9 + 7; const ll LINF = 1e18; const double PI = 3.14159265358979323846; template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } template<typename T> istream& operator >> (istream& is, vector<T>& vec) {for (T& x : vec) is >> x;return is;} template<typename T> ostream& operator << (ostream& os, vector<T>& vec) { for (int i = 0; i < vec.size(); i++) { os << vec[i] << (i + 1 == vec.size() ? "" : " "); } return os;} int ctoi(char c) { return (c >= '0' && c <= '9') ? c - '0' : 0; } #pragma region F #pragma endregion signed main() { INIT; // 必須 string A; cin >> A; string S; cin >> S; for (int i = 0; i < S.size(); i++) { if ('0' <= S[i] && S[i] <= '9') { S[i] = A[S[i] - '0']; } } cout << S << endl; return 0; }