結果
| 問題 | No.3637 PANDORA |
| コンテスト | |
| ユーザー |
shobonvip
|
| 提出日時 | 2026-08-25 14:10:03 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 188 ms / 2,000 ms |
| + 838µs | |
| コード長 | 1,872 bytes |
| 記録 | |
| コンパイル時間 | 4,476 ms |
| コンパイル使用メモリ | 377,664 KB |
| 実行使用メモリ | 59,060 KB |
| 最終ジャッジ日時 | 2026-08-25 14:10:26 |
| 合計ジャッジ時間 | 9,282 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| サブタスク | 配点 | 結果 |
|---|---|---|
| サンプル | 0 % | AC * 2 |
| 小課題1 | 5 % | AC * 4 |
| 小課題2 | 10 % | AC * 4 |
| 小課題3 | 5 % | AC * 8 |
| 小課題4 | 10 % | AC * 5 |
| 小課題5 | 20 % | AC * 10 |
| 小課題6 | 20 % | AC * 16 |
| 小課題7 | 30 % | AC * 38 |
| 合計 | 100 点 |
ソースコード
/**
author: shobonvip
created: 2026.08.25 14:04:13
**/
#include<bits/stdc++.h>
using namespace std;
//* ATCODER
#include<atcoder/all>
using namespace atcoder;
typedef modint998244353 mint;
//*/
/* BOOST MULTIPRECISION
#include<boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
//*/
typedef long long ll;
#define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++)
#define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--)
#define all(v) v.begin(), v.end()
template <typename T> bool chmin(T &a, const T &b) {
if (a <= b) return false;
a = b;
return true;
}
template <typename T> bool chmax(T &a, const T &b) {
if (a >= b) return false;
a = b;
return true;
}
template <typename T> T max(vector<T> &a){
assert(!a.empty());
T ret = a[0];
for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]);
return ret;
}
template <typename T> T min(vector<T> &a){
assert(!a.empty());
T ret = a[0];
for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]);
return ret;
}
template <typename T> T sum(vector<T> &a){
T ret = 0;
for (int i=0; i<(int)a.size(); i++) ret += a[i];
return ret;
}
int op(int a, int b) {
return a + b;
}
int e() {
return 0;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n, q;
cin >> n >> q;
string s; cin >> s;
vector<segtree<int,op,e>> seg(26, segtree<int,op,e>(n));
rep(i,0,n) {
seg[s[i] - 'a'].set(i, 1);
}
auto f = [&](int x) -> bool {
return x == 0;
};
while(q--) {
int t; cin >> t;
if (t == 1) {
int i; cin >> i; i--;
char c; cin >> c;
seg[s[i] - 'a'].set(i, 0);
s[i] = c;
seg[s[i] - 'a'].set(i, 1);
} else {
string t; cin >> t;
int m = (int)t.size();
int x = 0;
rep(i,0,m) {
x = seg[t[i] - 'a'].max_right(x, f);
x += 1;
if (x > n) break;
}
if (x <= n) cout << "Yes\n";
else cout << "No\n";
}
}
}
shobonvip