結果

問題 No.2000 Distanced Characters
ユーザー 加藤優太加藤優太
提出日時 2022-07-08 22:40:23
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 3,581 bytes
コンパイル時間 2,214 ms
コンパイル使用メモリ 169,616 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-27 22:25:58
合計ジャッジ時間 2,725 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#ifndef INCLUDED_MAIN
#define INCLUDED_MAIN

#include __FILE__

int main()
{
    string S = in_str();

    vi maxA(26, -1);
    vi minA(26, -1);
    rep(i, S.end() - S.begin() + 1)
    {
        maxA[S[i] - 'a'] = i;
    }
    repd(i, S.end() - S.begin())
    {
        minA[S[i] - 'a'] = i;
    }
    rep(i, 26)
    {
        rep(j, 26)
        {
            int d = in_int();
            if (d <= maxA[j] - minA[i])
                cout << "Y";
            else
                cout << "N";

            if (j != 25)
                cout << " ";
            else
                cout << endl;
        }
    }
    return 0;
}

#else

const int dd = 10; // decimal degits(小数の桁数)

#include <bits/stdc++.h>
using namespace std;

/* accelration */
// 高速バイナリ生成
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
// cin cout の結びつけ解除, stdioと同期しない(入出力非同期化)
// cとstdの入出力を混在させるとバグるので注意
struct Fast {
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
        //小数の桁数の出力指定
        cout << fixed << setprecision(dd);
    }
} fast;

/* alias */
using ull = unsigned long long;
using ll = long long;
using vi = vector<int>;
using vl = vector<long>;
using vll = vector<long long>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvll = vector<vll>;
using vs = vector<string>;
using pii = pair<int, int>;

/* define constants */
const int INF = (int)1e9;
const ll LINF = (int)1e18;
const double EPS = 1e-9;

/* define short */
#define pb push_back
#define mp make_pair
#define ft first
#define sd second
#define SZ(x) ((int)(x).size())
#define all(obj) (obj).begin(), (obj).end()
#define FILL(x, y) memset(x, y, sizeof(x))
#define YESNO(bool)            \
    if (bool) {                \
        cout << "YES" << endl; \
    } else {                   \
        cout << "NO" << endl;  \
    }
#define yesno(bool)            \
    if (bool) {                \
        cout << "yes" << endl; \
    } else {                   \
        cout << "no" << endl;  \
    }
#define YesNo(bool)            \
    if (bool) {                \
        cout << "Yes" << endl; \
    } else {                   \
        cout << "No" << endl;  \
    }

/* REP macro */
#define reps(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define rep(i, n) reps(i, 0, n)
#define rrep(i, n) reps(i, 1, n + 1)
#define repd(i, n) for (ll i = n - 1; i >= 0; i--)
#define rrepd(i, n) for (ll i = n; i >= 1; i--)

const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

/* Prevent duplication */
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

/*input output */

inline int in_int()
{
    int x;
    cin >> x;
    return x;
}
inline ll in_ll()
{
    ll x;
    cin >> x;
    return x;
}
inline string in_str()
{
    string x;
    cin >> x;
    return x;
}

template <typename T>
inline void print(const vector<T>& v, string s = " ")
{
    rep(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");
}
template <typename T, typename S>
inline void print(const pair<T, S>& p)
{
    cout << p.first << " " << p.second << endl;
}
template <typename T>
inline void print(const T& x) { cout << x << "\n"; }
template <typename T, typename S>
inline void print(const vector<pair<T, S>>& v)
{
    for (auto&& p : v)
        print(p);
}

#define debug(x) cerr << "\033[33m(line:" << __LINE__ << ") " << #x << ": " << x << "\033[m" << endl;

#endif
0