結果
問題 |
No.3261 yiwiy9 → yiwiY9
|
ユーザー |
|
提出日時 | 2025-09-06 13:38:34 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 3,141 bytes |
コンパイル時間 | 4,331 ms |
コンパイル使用メモリ | 251,712 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-06 13:38:55 |
合計ジャッジ時間 | 5,292 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 29 |
ソースコード
// https://qiita.com/Raclamusi/items/660f0f42c57e4371ed78 #ifdef INCLUDED_MAIN vc<string> solve(int H, ll W, std::vector<std::string> &S) { // TODO: edit here rep(i, H) { rep(j, W - 1) { if (S[i][j] == 'y' && S[i][j + 1] == '9') { S[i][j] = 'Y'; j += 1; continue; } if (S[i][j] == '9' && S[i][j + 1] == 'y') { S[i][j + 1] = 'Y'; j += 5; continue; } } } return S; } // generated by oj-template v4.8.1 (https://github.com/online-judge-tools/template-generator) int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(15); // ref:https://rsk0315.hatenablog.com/entry/2020/05/09/170315 // ll T; // cin >> T; // rep(i, T)solve(); int H; ll W; std::cin >> H; std::vector<std::string> S(H); std::cin >> W; rep(i, H) { std::cin >> S[i]; } auto ans = solve(H, W, S); rep(i, H) { std::cout << ans[i] << '\n'; } return 0; } #else // #ifndef ONLINE_JUDGE // #define _GLIBCXX_DEBUG 1 //[]で配列外参照をするとエラーにしてくれる。上下のやつがないとTLEになるので注意 ABC311Eのサンプル4みたいなデバック中のTLEは防げないので注意 // #endif #ifdef ONLINE_JUDGE #define NDEBUG #include <atcoder/all> #endif #include <bits/stdc++.h> // # include <boost/multiprecision/cpp_dec_float.hpp> // # include <boost/multiprecision/cpp_int.hpp> // # include <boost/rational.hpp> // namespace mp = boost::multiprecision; // // 任意長整数型 // using Bint = mp::cpp_int; // // 仮数部が32桁(10進数)の浮動小数点数型 // using Real32 = mp::number<mp::cpp_dec_float<32>>; // // 仮数部が1024桁(10進数)の浮動小数点数型 // using Real1024 = mp::number<mp::cpp_dec_float<1024>>; // // ついでに有理数型 // using Rat = boost::rational<Bint>; using namespace atcoder; using namespace std; using ll = long long; using ld = long double; #define double ld ll INF = 2e18; using P = pair<ll, ll>; #define pb push_back #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define reprev(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--) #define reps(i, n) for (ll i = 1; i <= (ll)(n); i++) #define for_(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++) #define all(v) v.begin(), v.end() template <typename T> inline bool chmin(T &a, const T &b) { bool c = a > b; if (c) a = b; return c; } template <typename T> inline bool chmax(T &a, const T &b) { bool c = a < b; if (c) a = b; return c; } template <typename T> inline T ceil(T a, T b) { return (a + (b - 1)) / b; } using mint = modint998244353; // using mint = modint1000000007; // using mint = static_modint<10>;//使うときはコメントアウトを外す template <typename T> using vc = vector<T>; template <class T> istream &operator>>(istream &i, vc<T> &v) { rep(j, (ll)size(v)) i >> v[j]; return i; } template <class T> ostream &operator<<(ostream &o, const vc<T> &v) { rep(j, (ll)size(v)) { if (j) o << " "; o << v[j]; } o << endl; return o; } #define INCLUDED_MAIN #include __FILE__ #endif