結果

問題 No.2460 #強調#
ユーザー ninesnines
提出日時 2023-09-08 22:39:57
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 4,703 bytes
コンパイル時間 4,462 ms
コンパイル使用メモリ 266,064 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 22:40:02
合計ジャッジ時間 5,255 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 1 ms
4,384 KB
testcase_13 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

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

// #include <atcoder/all>
// #include <atcoder/segtree>
// #include <atcoder/dsu>
// #include <atcoder/string>
// using namespace atcoder;

// #include <atcoder/modint>
// using mint = atcoder::modint1000000007;
// using mint = atcoder::modint998244353;

// #include <boost/multiprecision/cpp_int.hpp>
// using Bint = boost::multiprecision::cpp_int;

// #include <boost/multiprecision/cpp_dec_float.hpp>
// using Real = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1024>>;

// #include <boost/rational.hpp>
// using Rat = boost::rational<Bint>;

typedef long long ll;
const ll INF = 1e18;

// interactive
#define endl "\n"

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = ll(a); i < ll(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define rrep(i, n) for (ll i = ll(n) - 1; i >= 0; --i)

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define llacumulate(v) accumulate(all(v), 0LL)
#define sz(x) (ll)(x).size()
#define to_lower(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define to_upper(s) transform(s.begin(), s.end(), s.begin(), ::toupper)

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define pc __builtin_popcountll

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

using vi = vector<int>;
using vd = vector<double>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vs = vector<string>;
using vp = vector<pair<ll, ll>>;
using vpc = vector<pair<char, ll>>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;

void yn(bool b) { cout << (b ? "Yes" : "No") << endl; }
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;

struct Fast
{
    Fast()
    {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} fast;

template <typename T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <typename T>
bool chmin(T &a, const T &b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

vector<pair<char, ll>> run_length(const string &str)
{
    ll n = str.size();
    vector<pair<char, ll>> res;
    for (ll l = 0; l < n;)
    {
        ll r = l + 1;
        while (r < n && str[l] == str[r])
            ++r;
        res.push_back({str[l], r - l});
        l = r;
    }
    return res;
}

template <typename T, typename S>
int get_nearest(const vector<T> &v, const S &a)
{
    int x = lower_bound(all(v), a) - v.begin(), n = v.size();
    if (x == 0)
        return 0;
    if (x == n)
        return n - 1;
    if (abs(v[x] - a) < abs(v[x - 1] - a))
        return x;
    else
        return x - 1;
}

template <typename T>
vector<pair<ll, ll>> prime_factorize(T n)
{
    vector<pair<ll, ll>> res;
    for (ll i = 2; i * i <= n; ++i)
    {
        if (n % i != 0)
            continue;
        ll cnt = 0;
        while (n % i == 0)
        {
            n /= i;
            cnt++;
        }
        res.emplace_back(i, cnt);
    }
    if (n != 1)
        res.emplace_back(n, 1);
    return res;
}

void print() { cout << endl; }
template <typename T>
inline void print(const T &x) { cout << x << endl; }
template <class T, class... Ts>
void print(const T &a, const Ts &...b)
{
    cout << a;
    (cout << ... << (cout << ' ', b));
    cout << endl;
}
template <typename T>
inline void print(const vector<T> &v)
{
    rep(i, v.size())
    {
        if (i != (ll)v.size() - 1)
            cout << v[i] << " ";
        else
            cout << v[i] << endl;
    }
}
template <typename T>
inline void print(const vector<vector<T>> &v)
{
    for (auto &&p : v)
        print(p);
}
template <typename T, typename S>
inline void print(const pair<T, S> &p)
{
    cout << p.first << " " << p.second << endl;
}
template <typename T, typename S>
inline void print(const vector<pair<T, S>> &v)
{
    for (auto &&p : v)
        print(p);
}

#ifdef LOCAL
#include <library/debug_print.hpp>
#define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (static_cast<void>(0))
#endif

int main()
{
    string s;
    cin >> s;

    bool flag = false;
    string ans;
    for (auto x : s)
    {
        if (x == '#')
        {
            if (flag)
                flag = false;
            else
                flag = true;
        }else{
            if(flag)
                ans += x;
        }
    }
    print(ans);
}
0